提交 404e3c5d authored 作者: buckyballs's avatar buckyballs

Fix Issue 109 with "build spellcheck" ignoring errors if folder name includes '_'

上级 85abb7c2
...@@ -29,7 +29,7 @@ public class SpellChecker { ...@@ -29,7 +29,7 @@ public class SpellChecker {
"bz2", "rc", "layout", "res", "dll", "jar", "svg" }; "bz2", "rc", "layout", "res", "dll", "jar", "svg" };
private static final String DELIMITERS = " \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t"; private static final String DELIMITERS = " \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t";
private static final String PREFIX_IGNORE = "abc"; private static final String PREFIX_IGNORE = "abc";
private static final String IGNORE_FILE = "mainWeb.html"; private static final String[] IGNORE_FILES = {"mainWeb.html", "pg_catalog.sql"};
private HashSet<String> dictionary = new HashSet<String>(); private HashSet<String> dictionary = new HashSet<String>();
private HashSet<String> used = new HashSet<String>(); private HashSet<String> used = new HashSet<String>();
...@@ -89,12 +89,13 @@ public class SpellChecker { ...@@ -89,12 +89,13 @@ public class SpellChecker {
} }
} }
/** Searches for spelling errors in the source and documentation */
private void process(File file) throws IOException { private void process(File file) throws IOException {
String name = file.getCanonicalPath(); String name = file.getCanonicalPath();
if (name.endsWith(".svn")) { if (name.endsWith(".svn")) {
return; return;
} }
if (name.indexOf("_") > 0 && name.indexOf("_en") < 0) { if (file.getCanonicalFile().getName().startsWith("_") && name.indexOf("_en") < 0) {
return; return;
} }
if (file.isDirectory()) { if (file.isDirectory()) {
...@@ -117,8 +118,11 @@ public class SpellChecker { ...@@ -117,8 +118,11 @@ public class SpellChecker {
break; break;
} }
} }
if (fileName.endsWith(IGNORE_FILE)) { for (int i = 0; i < IGNORE_FILES.length; i++) {
if (fileName.endsWith(IGNORE_FILES[i])) {
ignore = true; ignore = true;
break;
}
} }
if (ignore) { if (ignore) {
return; return;
......
...@@ -320,7 +320,7 @@ possibility possible possibly post postal postgre postgres postgresql postmaster ...@@ -320,7 +320,7 @@ possibility possible possibly post postal postgre postgres postgresql postmaster
potential potentially pound pow power poweroff practice prd pre prec precision potential potentially pound pow power poweroff practice prd pre prec precision
preferdoslikelineends preferences preferred prefix prefixes premature prep preferdoslikelineends preferences preferred prefix prefixes premature prep
prepare prepared prepares preparing prepended prepends pres present preserve prepare prepared prepares preparing prepended prepends pres present preserve
press pressed pretty prev prevent previous previously pri price prices primary press pressed pretty prev prevent prevents previous previously pri price prices primary
prime primitive primitives principal print printed println prints prio prior prime primitive primitives principal print printed println prints prio prior
priority private privilege privileges probability probable probably problem priority private privilege privileges probability probable probably problem
problems proc procedural procedure procedures process processed processes problems proc procedural procedure procedures process processed processes
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论