Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 3 of 3 for isBadWord (0.1 seconds)

  1. src/test/java/org/codelibs/fess/suggest/entity/SuggestItemTest.java

            // Test isBadWord method
            String[] text = { "test", "text" };
            String[][] readings = { { "test" }, { "text" } };
            SuggestItem item = new SuggestItem(text, readings, null, 0L, 0L, 1.0f, null, null, null, SuggestItem.Kind.QUERY);
    
            // Test with no bad words
            String[] badWords = { "spam", "illegal" };
            assertFalse(item.isBadWord(badWords));
    
    Created: Fri Apr 17 09:08:13 GMT 2026
    - Last Modified: Mon Sep 01 13:33:03 GMT 2025
    - 16.7K bytes
    - Click Count (0)
  2. src/test/java/org/codelibs/fess/suggest/entity/SuggestItemBoundaryTest.java

        }
    
        @Test
        public void test_isBadWord_exactMatch() {
            String[] text = { "bad" };
            String[][] readings = { { "bad" } };
            SuggestItem item = new SuggestItem(text, readings, null, 0L, 0L, 1.0f, null, null, null, SuggestItem.Kind.QUERY);
    
            String[] badWords = { "bad" };
            assertTrue("Should match exact", item.isBadWord(badWords));
        }
    
    Created: Fri Apr 17 09:08:13 GMT 2026
    - Last Modified: Sat Jan 17 05:10:37 GMT 2026
    - 22.2K bytes
    - Click Count (0)
  3. src/main/java/org/codelibs/fess/suggest/entity/SuggestItem.java

         * Checks if the suggest item contains any of the given bad words.
         * @param badWords The array of bad words.
         * @return True if the item contains a bad word, false otherwise.
         */
        public boolean isBadWord(final String[] badWords) {
            for (final String badWord : badWords) {
                if (text.contains(badWord)) {
                    return true;
                }
            }
            return false;
        }
    
    Created: Fri Apr 17 09:08:13 GMT 2026
    - Last Modified: Sun Feb 01 12:48:24 GMT 2026
    - 13.5K bytes
    - Click Count (0)
Back to Top