Package com.atilika.kuromoji.trie.Trie

Examples of com.atilika.kuromoji.trie.Trie.Node


public class TrieTest {

    @Test
    public void testGetRoot() {
        Trie trie = new Trie();
        Node rootNode = trie.getRoot();
        assertNotNull(rootNode);
    }
View Full Code Here


        Trie trie = new Trie();
        trie.add("aa");
        trie.add("ab");
        trie.add("bb");

        Node rootNode = trie.getRoot();
        assertEquals(2, rootNode.getChildren().length);
        assertEquals(2, rootNode.getChildren()[0].getChildren().length);
        assertEquals(1, rootNode.getChildren()[1].getChildren().length);
    }
View Full Code Here

        Trie trie = new Trie();
        trie.add("aa");
        trie.add("ab");
        trie.add("bb");

        Node rootNode = trie.getRoot();
        assertEquals(2, rootNode.getChildren().length);
        assertEquals(2, rootNode.getChildren()[0].getChildren().length);
        assertEquals(1, rootNode.getChildren()[1].getChildren().length);
    }
View Full Code Here

        Trie trie = new Trie();
        assertTrue(trie.getRoot().hasSinglePath());
        trie.add("abcdef");
        assertTrue(trie.getRoot().hasSinglePath());
        trie.add("abdfg");
        Node rootNode = trie.getRoot();
        assertEquals(2, rootNode.getChildren()[0].getChildren()[0].getChildren().length);
        assertTrue(rootNode.getChildren()[0].getChildren()[0].getChildren()[0].hasSinglePath());
        assertTrue(rootNode.getChildren()[0].getChildren()[0].getChildren()[1].hasSinglePath());
    }
View Full Code Here

TOP

Related Classes of com.atilika.kuromoji.trie.Trie.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.