Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for isBadWord (0.07 sec)

  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));
    
    Registered: Fri Sep 19 09:08:11 UTC 2025
    - Last Modified: Mon Sep 01 13:33:03 UTC 2025
    - 16.7K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/fess/suggest/index/SuggestIndexer.java

         * @return The SuggestIndexResponse.
         */
        public SuggestIndexResponse index(final SuggestItem[] items) {
            // TODO parallel?
            final SuggestItem[] array = Stream.of(items).filter(item -> !item.isBadWord(badWords)).toArray(n -> new SuggestItem[n]);
    
            try {
                final long start = System.currentTimeMillis();
                final SuggestWriterResult result = suggestWriter.write(client, settings, index, array, true);
    Registered: Fri Sep 19 09:08:11 UTC 2025
    - Last Modified: Thu Aug 07 02:41:28 UTC 2025
    - 34.8K bytes
    - Viewed (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;
        }
    
    Registered: Fri Sep 19 09:08:11 UTC 2025
    - Last Modified: Thu Aug 07 02:41:28 UTC 2025
    - 25.1K bytes
    - Viewed (0)
Back to top