Пример #1
0
 @Test
 public void testTCData() {
   final InputStream stream = SplitterTest.class.getResourceAsStream("contents.txt");
   String text = convertStreamToString(stream);
   List<String> words = wordsToCheck(PlainTextSplitter.getInstance(), text);
   assertEquals(0, words.size());
 }
Пример #2
0
 @Test
 public void testSemicolonSeparatedList() {
   String text = "properties;test;properties";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "properties", "test", "properties");
 }
Пример #3
0
 @Test
 public void testWordWithUmlauts() {
   String text = "rechtsb\u00FCndig";
   correctListToCheck(PlainTextSplitter.getInstance(), text, text);
 }
Пример #4
0
 @Test
 public void testWordInCapsAfterDelimiter3() {
   String text = ";BADD;";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "BADD");
 }
Пример #5
0
 @Test
 public void testWordInCapsBeforeDelimiter() {
   String text = "BADD,";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "BADD");
 }
Пример #6
0
 @Test
 public void testCheckXmlIgnored() {
   String text = "abcdef" + new String(new char[] {0xDC00}) + "test";
   correctListToCheck(PlainTextSplitter.getInstance(), text);
 }
Пример #7
0
 @Test
 public void testWordWithApostrophe1() {
   String text = "don't check";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "don't", "check");
 }
Пример #8
0
 @Test
 public void testWordsInSingleQuotesWithSep() {
   String text = "'test-something'";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "test", "something");
 }
Пример #9
0
 @Test
 public void testEmailOnly() {
   String text = "shkate123-\[email protected]";
   correctListToCheck(PlainTextSplitter.getInstance(), text);
 }
Пример #10
0
 @Test
 public void testEmail() {
   String text = "some text with email ([email protected]) inside";
   correctListToCheck(
       PlainTextSplitter.getInstance(), text, "some", "text", "with", "email", "inside");
 }
Пример #11
0
 @Test
 public void testTooShort() {
   String text = "bgColor carLight";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "Color", "Light");
 }
Пример #12
0
 @Test
 public void testSpecial() {
   String text = "test &nbsp; test &sup; &gt;";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "test", "test");
 }
Пример #13
0
 @Test
 public void testStringLiterals() {
   String text = "test\ntest\n";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "test", "test");
 }
Пример #14
0
 @Test
 public void testWordWithApostrophe5() {
   String text = "I'm you're we'll";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "you're", "we'll");
 }
Пример #15
0
 @Test
 public void testWordWithApostrophe3() {
   String text = "customer's";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "customer's");
 }
Пример #16
0
 @Test
 public void testWordUpperCasedWithUmlautsInTheBeginning() {
   String text = "\u00DCNDIG";
   correctListToCheck(PlainTextSplitter.getInstance(), text, text);
 }
Пример #17
0
 @Test
 public void testUrl() {
   String text = "https://www.jetbrains.com/idea";
   correctListToCheck(PlainTextSplitter.getInstance(), text);
 }
Пример #18
0
 @Test
 public void testUrlThenSpaces() {
   String text = "https://www.jetbrains.com/idea asdasdasd sdfsdf";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "asdasdasd", "sdfsdf");
 }
Пример #19
0
 @Test
 public void testComplexWordsInQuotes() {
   String text = "\"test-customer's'\"";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "test", "customer's");
 }
Пример #20
0
 @Test
 public void testWordAfterDelimiter() {
   String text = ",badd";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "badd");
 }
Пример #21
0
 @Test
 public void testHexInPlainText() {
   String text = "some text 0xacvfgt";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "some", "text");
 }
Пример #22
0
 @Test
 public void testHexInStringLiteral() {
   String text = "qwerty 0x12acfgt test";
   correctListToCheck(PlainTextSplitter.getInstance(), text, "qwerty", "test");
 }