@Test public void testTagger() throws IOException { assertSents( Lists.newArrayList( "(TOP (ADJF,accs,inan,plur женские) (NOUN,inan,masc,nomn,plur сапоги))", "(TOP (ADJF,accs,inan,plur женские) (NOUN,accs,inan,masc,plur сапоги))", "(TOP (ADJF,nomn,plur женские) (NOUN,inan,masc,nomn,plur сапоги))", "(TOP (ADJF,nomn,plur женские) (NOUN,accs,inan,masc,plur сапоги))" ), tagger.tagAll(new String[]{"женские", "сапоги"}) ); assertSents( Lists.newArrayList( "(TOP (ADJF,accs,inan,plur женские) (NOUN,inan,masc,nomn,plur сапоги) (PREP на) (NOUN,accs,femn,inan,sing зиму))", "(TOP (ADJF,accs,inan,plur женские) (NOUN,accs,inan,masc,plur сапоги) (PREP на) (NOUN,accs,femn,inan,sing зиму))", "(TOP (ADJF,nomn,plur женские) (NOUN,inan,masc,nomn,plur сапоги) (PREP на) (NOUN,accs,femn,inan,sing зиму))", "(TOP (ADJF,nomn,plur женские) (NOUN,accs,inan,masc,plur сапоги) (PREP на) (NOUN,accs,femn,inan,sing зиму))" ), tagger.tagAll(new String[]{"женские", "сапоги", "на", "зиму"}) ); assertSents(Lists.newArrayList("(TOP (NOUN,inan,masc,nomn,sing чехол) (PREP для) (LATN iphone) (LATN 4s))", "(TOP (NOUN,accs,inan,masc,sing чехол) (PREP для) (LATN iphone) (LATN 4s))"), tagger.tagAll(new String[]{"чехол", "для", "iphone", "4s"})); }
public List<Node.Top> tagAll(String[] tokens) throws IOException { List<Node.Top> results = new ArrayList<Node.Top>(); if (tokens.length != 0) { tagAll(results, new LinkedList<Node>(), makeTokens(tokens)); Collections.sort(results, Collections.reverseOrder(Node.scoreComparator())); } return results; }
SimpleTagger extends Tagger { public List<Node.Top> tagAll(String[] tokens) throws IOException { List<Node.Top> results = new ArrayList<Node.Top>(); if (tokens.length != 0) { tagAll(results, new LinkedList<Node>(), makeTokens(tokens)); Collections.sort(results, Collections.reverseOrder(Node.scoreComparator())); } return results; } }
SimpleTagger extends Tagger { public List<Node.Top> tagAll(String[] tokens) throws IOException { List<Node.Top> results = new ArrayList<Node.Top>(); if (tokens.length != 0) { tagAll(results, new LinkedList<Node>(), makeTokens(tokens)); Collections.sort(results, Collections.reverseOrder(Node.scoreComparator())); } return results; } SimpleTagger(MorphAnalyzer morph);  SimpleTagger(MorphAnalyzer morph, Ruleset rules);  SimpleTagger(MorphAnalyzer morph, int threshold);  SimpleTagger(MorphAnalyzer morph, Ruleset rules, int threshold); }
SimpleTagger extends Tagger { public List<Node.Top> tagAll(String[] tokens) throws IOException { List<Node.Top> results = new ArrayList<Node.Top>(); if (tokens.length != 0) { tagAll(results, new LinkedList<Node>(), makeTokens(tokens)); Collections.sort(results, Collections.reverseOrder(Node.scoreComparator())); } return results; } SimpleTagger(MorphAnalyzer morph);  SimpleTagger(MorphAnalyzer morph, Ruleset rules);  SimpleTagger(MorphAnalyzer morph, int threshold);  SimpleTagger(MorphAnalyzer morph, Ruleset rules, int threshold); List<Node.Top> tagAll(String[] tokens); Node.Top tag(String[] tokens); }
SimpleTagger extends Tagger { public List<Node.Top> tagAll(String[] tokens) throws IOException { List<Node.Top> results = new ArrayList<Node.Top>(); if (tokens.length != 0) { tagAll(results, new LinkedList<Node>(), makeTokens(tokens)); Collections.sort(results, Collections.reverseOrder(Node.scoreComparator())); } return results; } SimpleTagger(MorphAnalyzer morph);  SimpleTagger(MorphAnalyzer morph, Ruleset rules);  SimpleTagger(MorphAnalyzer morph, int threshold);  SimpleTagger(MorphAnalyzer morph, Ruleset rules, int threshold); List<Node.Top> tagAll(String[] tokens); Node.Top tag(String[] tokens); static final int DEFAULT_THRESHOLD; static final Ruleset defaultRules; }