assertEquals(TweetDetector.NL, tw.getLanguage());
}
@Test
public void testLanguageDetection3() {
JTweet tw = new JTweet(1L, "tmptext", new JUser("tmp"));
tw.getLanguages().inc("de", 1);
StringFreqMap otherLanguages = new StringFreqMap();
assertEquals(TweetDetector.UNKNOWN_LANG, new TermCreateCommand().detectLanguage(tw, otherLanguages));
tw = new JTweet(1L, "tmptext", new JUser("tmp"));
tw.getLanguages().inc("de", 2);
otherLanguages = new StringFreqMap().set("de", 1);
assertEquals("de", new TermCreateCommand().detectLanguage(tw, otherLanguages));
tw = new JTweet(1L, "tmptext", new JUser("tmp"));
tw.getLanguages().inc(TweetDetector.UNKNOWN_LANG, 2);
tw.getLanguages().inc("de", 2);
otherLanguages = new StringFreqMap().set("de", 1);
assertEquals("de", new TermCreateCommand().detectLanguage(tw, otherLanguages));
tw = new JTweet(1L, "tmptext", new JUser("tmp"));
tw.getLanguages().inc(TweetDetector.UNKNOWN_LANG, 2);
tw.getLanguages().inc("de", 2);
tw.getLanguages().inc("en", 2);
otherLanguages = new StringFreqMap().set("de", 1).set("en", 1);
assertEquals(TweetDetector.UNKNOWN_LANG, new TermCreateCommand().detectLanguage(tw, otherLanguages));