コード例 #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");
 }