ASM #16693 Fix spelling checker swear words
Change-Id: I0a31429fa35a5c5a8f4d2f000021db4e4304de9e Former-commit-id:8eb9aac0b9
[formerly2a38e3eca5
] [formerly12c545ef7a
[formerly 1686a947c8a740c34339d9cf17749a6b92d776ab]] Former-commit-id:12c545ef7a
Former-commit-id:f26b61bbb7
This commit is contained in:
parent
fd995aa76c
commit
476d52b18d
2 changed files with 7 additions and 43006 deletions
File diff suppressed because it is too large
Load diff
|
@ -21,6 +21,7 @@ package com.raytheon.uf.viz.spellchecker.dialogs;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -77,6 +78,7 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 18 APR 2008 ### lvenable Initial creation
|
* 18 APR 2008 ### lvenable Initial creation
|
||||||
* 01Mar2010 4765 MW Fegan Moved from GFE plug-in.
|
* 01Mar2010 4765 MW Fegan Moved from GFE plug-in.
|
||||||
|
* 09/24/2014 #16693 lshi filter out swear words in spelling check
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -85,6 +87,8 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
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 transient IUFStatusHandler statusHandler = UFStatus.getHandler(SpellCheckDlg.class);
|
||||||
|
|
||||||
private static final Pattern DIGITS = Pattern.compile("\\d");
|
private static final Pattern DIGITS = Pattern.compile("\\d");
|
||||||
|
@ -348,7 +352,8 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
||||||
if (pdMatch.matches()) {
|
if (pdMatch.matches()) {
|
||||||
String replString = pdMatch.group(1).toUpperCase();
|
String replString = pdMatch.group(1).toUpperCase();
|
||||||
// proposals may include case changes, which get lost
|
// proposals may include case changes, which get lost
|
||||||
if (replString != badWord) {
|
//if (replString != badWord) {
|
||||||
|
if (!swearWords.contains(replString) && !replString.equals(badWord)) {
|
||||||
suggestionList.add(replString);
|
suggestionList.add(replString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue