@@ -91,7 +91,7 @@ else if (charTypeArray[i] == CharType.CT_LETTER)
91
91
nCurType = charTypeArray [pCur - start ];
92
92
93
93
if (nCurType == CharType .CT_CHINESE || nCurType == CharType .CT_INDEX ||
94
- nCurType == CharType .CT_DELIMITER || nCurType == CharType .CT_OTHER )
94
+ nCurType == CharType .CT_DELIMITER || nCurType == CharType .CT_OTHER )
95
95
{
96
96
String single = String .valueOf (charArray [pCur ]);
97
97
if (single .length () != 0 )
@@ -169,9 +169,9 @@ protected static List<AtomNode> quickAtomSegment(char[] charArray, int start, in
169
169
// 浮点数识别
170
170
if (preType == CharType .CT_NUM && ",,.." .indexOf (charArray [offsetAtom ]) != -1 )
171
171
{
172
- if (offsetAtom + 1 < end )
172
+ if (offsetAtom + 1 < end )
173
173
{
174
- int nextType = CharType .get (charArray [offsetAtom + 1 ]);
174
+ int nextType = CharType .get (charArray [offsetAtom + 1 ]);
175
175
if (nextType == CharType .CT_NUM )
176
176
{
177
177
continue ;
@@ -191,6 +191,7 @@ protected static List<AtomNode> quickAtomSegment(char[] charArray, int start, in
191
191
192
192
/**
193
193
* 使用用户词典合并粗分结果
194
+ *
194
195
* @param vertexList 粗分结果
195
196
* @return 合并后的结果
196
197
*/
@@ -201,8 +202,9 @@ protected static List<Vertex> combineByCustomDictionary(List<Vertex> vertexList)
201
202
202
203
/**
203
204
* 使用用户词典合并粗分结果
205
+ *
204
206
* @param vertexList 粗分结果
205
- * @param dat 用户自定义词典
207
+ * @param dat 用户自定义词典
206
208
* @return 合并后的结果
207
209
*/
208
210
protected static List <Vertex > combineByCustomDictionary (List <Vertex > vertexList , DoubleArrayTrie <CoreDictionary .Attribute > dat )
@@ -280,6 +282,7 @@ protected static List<Vertex> combineByCustomDictionary(List<Vertex> vertexList,
280
282
281
283
/**
282
284
* 使用用户词典合并粗分结果,并将用户词语收集到全词图中
285
+ *
283
286
* @param vertexList 粗分结果
284
287
* @param wordNetAll 收集用户词语到全词图中
285
288
* @return 合并后的结果
@@ -291,8 +294,9 @@ protected static List<Vertex> combineByCustomDictionary(List<Vertex> vertexList,
291
294
292
295
/**
293
296
* 使用用户词典合并粗分结果,并将用户词语收集到全词图中
297
+ *
294
298
* @param vertexList 粗分结果
295
- * @param dat 用户自定义词典
299
+ * @param dat 用户自定义词典
296
300
* @param wordNetAll 收集用户词语到全词图中
297
301
* @return 合并后的结果
298
302
*/
@@ -323,10 +327,11 @@ public void hit(int begin, int end, CoreDictionary.Attribute value)
323
327
324
328
/**
325
329
* 将连续的词语合并为一个
330
+ *
326
331
* @param wordNet 词图
327
- * @param start 起始下标(包含)
328
- * @param end 结束下标(不包含)
329
- * @param value 新的属性
332
+ * @param start 起始下标(包含)
333
+ * @param end 结束下标(不包含)
334
+ * @param value 新的属性
330
335
*/
331
336
private static void combineWords (Vertex [] wordNet , int start , int end , CoreDictionary .Attribute value )
332
337
{
@@ -401,6 +406,7 @@ static Term convert(Vertex vertex)
401
406
402
407
/**
403
408
* 合并数字
409
+ *
404
410
* @param termList
405
411
*/
406
412
protected void mergeNumberQuantifier (List <Vertex > termList , WordNet wordNetAll , Config config )
@@ -461,10 +467,11 @@ protected void mergeNumberQuantifier(List<Vertex> termList, WordNet wordNetAll,
461
467
462
468
/**
463
469
* 将一个词语从词网中彻底抹除
464
- * @param cur 词语
470
+ *
471
+ * @param cur 词语
465
472
* @param wordNetAll 词网
466
- * @param line 当前扫描的行数
467
- * @param length 当前缓冲区的长度
473
+ * @param line 当前扫描的行数
474
+ * @param length 当前缓冲区的长度
468
475
*/
469
476
private static void removeFromWordNet (Vertex cur , WordNet wordNetAll , int line , int length )
470
477
{
@@ -724,11 +731,11 @@ public Segment enableCustomDictionary(boolean enable)
724
731
725
732
/**
726
733
* 是否尽可能强制使用用户词典(使用户词典的优先级尽可能高)<br>
727
- * 警告:具体实现由各子类决定,可能会破坏分词器的统计特性(例如,如果用户词典
728
- * 含有“和服”,则“商品和服务”的分词结果可能会被用户词典的高优先级影响)。
734
+ * 警告:具体实现由各子类决定,可能会破坏分词器的统计特性(例如,如果用户词典
735
+ * 含有“和服”,则“商品和服务”的分词结果可能会被用户词典的高优先级影响)。
736
+ *
729
737
* @param enable
730
738
* @return 分词器本身
731
- *
732
739
* @since 1.3.5
733
740
*/
734
741
public Segment enableCustomDictionaryForcing (boolean enable )
@@ -779,7 +786,8 @@ public Segment enableOffset(boolean enable)
779
786
780
787
/**
781
788
* 是否启用数词和数量词识别<br>
782
- * 即[二, 十, 一] => [二十一],[十, 九, 元] => [十九元]
789
+ * 即[二, 十, 一] => [二十一],[十, 九, 元] => [十九元]
790
+ *
783
791
* @param enable
784
792
* @return
785
793
*/
@@ -833,6 +841,7 @@ public void run()
833
841
834
842
/**
835
843
* 开启多线程
844
+ *
836
845
* @param enable true表示开启[系统CPU核心数]个线程,false表示单线程
837
846
* @return
838
847
*/
@@ -845,6 +854,7 @@ public Segment enableMultithreading(boolean enable)
845
854
846
855
/**
847
856
* 开启多线程
857
+ *
848
858
* @param threadNumber 线程数量
849
859
* @return
850
860
*/
0 commit comments