@@ -0,0 +1,2296 @@
+package com.github.rholder.nlp.tagging;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport static com.github.rholder.nlp.tagging.Tokenizer.wordsToList;%0A%0Apublic class FastTagTest %7B%0A%0A    private static final FastTag FAST_TAG = new FastTag(Lexicon.fromClasspath(%22fast-tag-lexicon.txt%22));%0A%0A    @Test%0A    public void happyPath() %7B%0A        List%3CString%3E words = wordsToList(%22The ball rolled down the street.%22);%0A        List%3CString%3E expectedTags = Arrays.asList(%22DT%22, %22NN%22, %22VBD%22, %22RB%22, %22DT%22, %22NN%22, %22.%22);%0A        checkFor(expectedTags, words);%0A    %7D%0A%0A    @Test%0A    public void duchess() %7B%0A        // this is intentionally ambiguous, it gets pretty close%0A        List%3CString%3E words = wordsToList(%22The Duchess was entertaining last night.%22);%0A        List%3CString%3E expected = Arrays.asList(%22DT%22, %22NNP%22, %22VBD%22, %22VBG%22, %22JJ%22, %22NN%22, %22.%22);%0A        checkFor(expected, words);%0A    %7D%0A%0A    @Test%0A    public void fireTruck() %7B%0A        // this is intentionally ambiguous%0A        List%3CString%3E words = wordsToList(%22the big green fire truck%22);%0A        List%3CString%3E expected = Arrays.asList(%22DT%22, %22JJ%22, %22JJ%22, %22NN%22, %22NN%22);%0A        checkFor(expected, words);%0A    %7D%0A%0A    @Test%0A    public void blue() %7B%0A        List%3CString%3E words = wordsToList(%22the word %5C%22blue%5C%22 has 4 letters.%22);%0A        List%3CString%3E expected = Arrays.asList(%22DT%22, %22NN%22, %22JJ%22, %22VBZ%22, %224%5E%22, %22NNS%22, %22.%22);%0A        checkFor(expected, words);%0A    %7D%0A%0A    @Ignore(%22jumps is being incorrectly identified as NNS here, should be VBZ%22)%0A    @Test%0A    public void someFoxes() %7B%0A        List%3CString%3E words = wordsToList(%22The quick brown fox jumps over the lazy dog.%22);%0A        List%3CString%3E expected = Arrays.asList(%22DT%22, %22JJ%22, %22JJ%22, %22NN%22, %22VBZ%22, %22IN%22, %22DT%22, %22JJ%22, %22NN%22, %22.%22);%0A        checkFor(expected, words);%0A    %7D%0A%0A    private void checkFor(List%3CString%3E expectedTags, List%3CString%3E words) %7B%0A        List%3CString%3E tags = FAST_TAG.tag(words);%0A        for (int i = 0; i %3C words.size(); i++) %7B%0A            String expectedTag = expectedTags.get(i);%0A            String tag = tags.get(i);%0A            String word = words.get(i);%0A            //System.out.println(words.get(i) + %22 / %22 + tags.get(i));%0A            Assert.assertEquals(%22Unexpected tag for: %22 + word, expectedTag, tag);%0A        %7D%0A    %7D%0A%7D%0A

add some tests to verify behavior