ASM #16693 Fix spelling checker swear words

Change-Id: I0a31429fa35a5c5a8f4d2f000021db4e4304de9e

Former-commit-id: 12c545ef7a [formerly 2a38e3eca5 [formerly 1686a947c8a740c34339d9cf17749a6b92d776ab]]
Former-commit-id: 2a38e3eca5
Former-commit-id: 8eb9aac0b9
This commit is contained in:
Ying-Lian.Shi 2014-09-24 12:08:43 +00:00
parent 690dd467d4
commit aa0b2544fd
2 changed files with 7 additions and 43006 deletions

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.spellchecker.dialogs;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedList;
@ -77,6 +78,7 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
* ------------ ---------- ----------- --------------------------
* 18 APR 2008 ### lvenable Initial creation
* 01Mar2010 4765 MW Fegan Moved from GFE plug-in.
* 09/24/2014 #16693 lshi filter out swear words in spelling check
*
* </pre>
*
@ -85,6 +87,8 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
*
*/
public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
private static java.util.List<String> swearWords = Arrays.asList("ASSHOLE");
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SpellCheckDlg.class);
private static final Pattern DIGITS = Pattern.compile("\\d");
@ -348,7 +352,8 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
if (pdMatch.matches()) {
String replString = pdMatch.group(1).toUpperCase();
// proposals may include case changes, which get lost
if (replString != badWord) {
//if (replString != badWord) {
if (!swearWords.contains(replString) && !replString.equals(badWord)) {
suggestionList.add(replString);
}
}