Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f4871d9f
提交
f4871d9f
authored
1月 30, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
7de9aac9
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
473 行增加
和
397 行删除
+473
-397
PropertiesToUTF8.java
h2/src/tools/org/h2/tools/code/PropertiesToUTF8.java
+0
-12
SpellChecker.java
h2/src/tools/org/h2/tools/doc/SpellChecker.java
+31
-29
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+442
-356
没有找到文件。
h2/src/tools/org/h2/tools/code/PropertiesToUTF8.java
浏览文件 @
f4871d9f
...
@@ -11,7 +11,6 @@ import java.io.InputStreamReader;
...
@@ -11,7 +11,6 @@ import java.io.InputStreamReader;
import
java.io.OutputStreamWriter
;
import
java.io.OutputStreamWriter
;
import
java.io.RandomAccessFile
;
import
java.io.RandomAccessFile
;
import
org.h2.server.web.PageParser
;
import
org.h2.tools.indexer.HtmlConverter
;
import
org.h2.tools.indexer.HtmlConverter
;
import
org.h2.util.IOUtils
;
import
org.h2.util.IOUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
...
@@ -49,15 +48,4 @@ public class PropertiesToUTF8 {
...
@@ -49,15 +48,4 @@ public class PropertiesToUTF8 {
}
}
}
}
private
static
String
unescapeHtml
(
String
s
)
{
String
codes
=
"< < & & > > Ä \u00c4 Ö \u00d6 Ü \u00dc ä \u00e4 ö \u00f6 ü \u00fc ñ \u00f1 ó \u00f3 Í \u00cd ç \u00e7 &eagrave; \u00e8 ê \u00ea Ú \u00da á \u00e1 ú \u00fa é \u00e9 è \u00e8 î \u00ee"
;
String
[]
list
=
StringUtils
.
arraySplit
(
codes
,
' '
,
false
);
for
(
int
i
=
0
;
i
<
list
.
length
;
i
+=
2
)
{
s
=
StringUtils
.
replaceAll
(
s
,
list
[
i
],
list
[
i
+
1
]);
}
if
(
s
.
indexOf
(
"&"
)
>=
0
)
{
throw
new
Error
(
"??? "
+
s
);
}
return
s
;
}
}
}
h2/src/tools/org/h2/tools/doc/SpellChecker.java
浏览文件 @
f4871d9f
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
tools
.
doc
;
package
org
.
h2
.
tools
.
doc
;
import
java.io.File
;
import
java.io.File
;
...
@@ -21,8 +25,12 @@ public class SpellChecker {
...
@@ -21,8 +25,12 @@ public class SpellChecker {
private
boolean
debug
;
private
boolean
debug
;
private
boolean
printDictionary
;
private
boolean
printDictionary
;
private
boolean
addToDictionary
;
private
boolean
addToDictionary
;
private
static
final
String
[]
SUFFIX
=
new
String
[]{
"java"
,
"sql"
,
"cpp"
,
"txt"
,
"html"
,
"xml"
,
"jsp"
,
"css"
,
"bat"
,
"nsi"
,
"csv"
,
"xml"
,
"js"
,
"def"
,
"dev"
,
"h"
,
"Driver"
,
"properties"
,
"win"
,
"task"
,
"php"
,
""
};
private
static
final
String
[]
SUFFIX
=
new
String
[]{
private
static
final
String
[]
IGNORE
=
new
String
[]{
"gif"
,
"png"
,
"odg"
,
"ico"
,
"sxd"
,
"zip"
,
"bz2"
,
"rc"
,
"layout"
,
"res"
,
"dll"
,
"jar"
};
"html"
,
"java"
,
"sql"
,
"txt"
,
"xml"
,
"jsp"
,
"css"
,
"bat"
,
"csv"
,
"xml"
,
"js"
,
"Driver"
,
"properties"
,
"task"
,
"php"
,
""
};
private
static
final
String
[]
IGNORE
=
new
String
[]{
"cpp"
,
"h"
,
"win"
,
"dev"
,
"def"
,
"nsi"
,
"gif"
,
"png"
,
"odg"
,
"ico"
,
"sxd"
,
"zip"
,
"bz2"
,
"rc"
,
"layout"
,
"res"
,
"dll"
,
"jar"
};
private
static
final
String
PREFIX_IGNORE
=
"abc"
;
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
dir
=
"src"
;
String
dir
=
"src"
;
...
@@ -57,27 +65,20 @@ public class SpellChecker {
...
@@ -57,27 +65,20 @@ public class SpellChecker {
System
.
out
.
println
(
"UNKNOWN WORDS"
);
System
.
out
.
println
(
"UNKNOWN WORDS"
);
for
(
Iterator
it
=
unknown
.
keySet
().
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
it
=
unknown
.
keySet
().
iterator
();
it
.
hasNext
();)
{
String
s
=
(
String
)
it
.
next
();
String
s
=
(
String
)
it
.
next
();
int
count
=
((
Integer
)
unknown
.
get
(
s
)).
intValue
();
// int count = ((Integer) unknown.get(s)).intValue();
if
(
count
>
5
)
{
System
.
out
.
print
(
s
+
" "
);
System
.
out
.
print
(
s
+
" "
);
}
}
}
System
.
out
.
println
();
System
.
out
.
println
();
System
.
out
.
println
();
throw
new
IOException
(
"spell check failed"
);
throw
new
IOException
(
"spell check failed"
);
}
}
}
}
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"
)
||
name
.
indexOf
(
"_text_"
)
>
0
)
{
return
;
return
;
}
}
int
removeThisLater
;
// if(name.indexOf("\\test\\") >= 0) {
// return;
// }
if
(
file
.
isDirectory
())
{
if
(
file
.
isDirectory
())
{
File
[]
list
=
file
.
listFiles
();
File
[]
list
=
file
.
listFiles
();
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
...
@@ -112,22 +113,20 @@ public class SpellChecker {
...
@@ -112,22 +113,20 @@ public class SpellChecker {
if
(!
ok
)
{
if
(!
ok
)
{
throw
new
IOException
(
"Unsupported suffix: "
+
suffix
+
" for file: "
+
fileName
);
throw
new
IOException
(
"Unsupported suffix: "
+
suffix
+
" for file: "
+
fileName
);
}
}
if
(
"java"
.
equals
(
suffix
)
||
"xml"
.
equals
(
suffix
)
||
"txt"
.
equals
(
suffix
))
{
FileReader
reader
=
null
;
FileReader
reader
=
null
;
String
text
=
null
;
String
text
=
null
;
try
{
try
{
reader
=
new
FileReader
(
file
);
reader
=
new
FileReader
(
file
);
text
=
readStringAndClose
(
reader
,
-
1
);
text
=
readStringAndClose
(
reader
,
-
1
);
}
finally
{
}
finally
{
IOUtils
.
closeSilently
(
reader
);
IOUtils
.
closeSilently
(
reader
);
}
if
(
fileName
.
endsWith
(
"dictionary.txt"
))
{
addToDictionary
=
true
;
}
else
{
addToDictionary
=
false
;
}
scan
(
fileName
,
text
);
}
}
if
(
fileName
.
endsWith
(
"dictionary.txt"
))
{
addToDictionary
=
true
;
}
else
{
addToDictionary
=
false
;
}
scan
(
fileName
,
text
);
}
}
}
}
...
@@ -200,7 +199,10 @@ public class SpellChecker {
...
@@ -200,7 +199,10 @@ public class SpellChecker {
token
=
token
.
toLowerCase
();
token
=
token
.
toLowerCase
();
if
(!
addToDictionary
&&
debug
)
{
if
(!
addToDictionary
&&
debug
)
{
System
.
out
.
print
(
token
+
" "
);
System
.
out
.
print
(
token
+
" "
);
}
}
if
(
token
.
startsWith
(
PREFIX_IGNORE
))
{
return
;
}
if
(
addToDictionary
)
{
if
(
addToDictionary
)
{
dictionary
.
add
(
token
);
dictionary
.
add
(
token
);
}
else
{
}
else
{
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
f4871d9f
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论