@Test
    public void testArrayEmbedTo3dMixedTensor() {
        var tester = new EmbeddingScriptTester(Map.of("emb1", new EmbeddingScriptTester.MockMixedEmbedder("myDocument.mySparseTensor")));

        TensorType tensorType = TensorType.fromSpec("tensor(passage{}, token{}, d[3])");
        var expression = tester.expressionFrom("input myTextArray | embed emb1 passage | attribute 'mySparseTensor'");
        assertEquals("input myTextArray | embed emb1 passage | attribute mySparseTensor", expression.toString());

        SimpleTestAdapter adapter = new SimpleTestAdapter();
        adapter.createField(new Field("myTextArray", new ArrayDataType(DataType.STRING)));
        var tensorField = new Field("mySparseTensor", new TensorDataType(tensorType));
        adapter.createField(tensorField);

        var array = new Array<StringFieldValue>(new ArrayDataType(DataType.STRING));
        array.add(new StringFieldValue("first"));
        array.add(new StringFieldValue("sec"));
        adapter.setValue("myTextArray", array);
        expression.setStatementOutput(new DocumentType("myDocument"), tensorField);

        expression.resolve(new TypeContext(adapter));

        ExecutionContext context = new ExecutionContext(adapter);
        context.setCurrentValue(array);
        expression.execute(context);
        assertTrue(adapter.values.containsKey("mySparseTensor"));
        var sparseTensor = (TensorFieldValue) adapter.values.get("mySparseTensor");
        // The two "passages" are [first, sec], the middle (d=1) token encodes those letters
        assertEquals(Tensor.from(tensorType,
                                 """
                                 {
                                 {passage:0, token:0, d:0}: 101,
                                 {passage:0, token:0, d:1}: 102,
                                 {passage:0, token:0, d:2}: 103,
                                 {passage:0, token:1, d:0}: 104,
                                 {passage:0, token:1, d:1}: 105,
                                 {passage:0, token:1, d:2}: 106,
                                 {passage:0, token:2, d:0}: 113,
                                 {passage:0, token:2, d:1}: 114,
                                 {passage:0, token:2, d:2}: 115,
                                 {passage:0, token:3, d:0}: 114,
                                 {passage:0, token:3, d:1}: 115,
                                 {passage:0, token:3, d:2}: 116,
                                 {passage:0, token:4, d:0}: 115,
                                 {passage:0, token:4, d:1}: 116,
                                 {passage:0, token:4, d:2}: 117,
                                 {passage:1, token:0, d:0}: 114,
                                 {passage:1, token:0, d:1}: 115,
                                 {passage:1, token:0, d:2}: 116,
                                 {passage:1, token:1, d:0}: 100,
                                 {passage:1, token:1, d:1}: 101,
                                 {passage:1, token:1, d:2}: 102,
                                 {passage:1, token:2, d:0}:  98,
                                 {passage:1, token:2, d:1}:  99,
                                 {passage:1, token:2, d:2}: 100
                                 }
                                 """),
                     sparseTensor.getTensor().get());
    }
Multiple paragraphs, and each paragraph leading to multiple vectors (ColBert style)
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/EmbeddingScriptTestCase.java