mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -46,7 +46,7 @@ public class AnalysisEngine implements TokenizerEngine {
|
||||
public Result parse(final CharSequence text) {
|
||||
final TokenStream stream;
|
||||
try {
|
||||
stream = analyzer.tokenStream("text", StrUtil.str(text));
|
||||
stream = analyzer.tokenStream("text", StrUtil.toStringOrEmpty(text));
|
||||
stream.reset();
|
||||
} catch (final IOException e) {
|
||||
throw new TokenizerException(e);
|
||||
|
@@ -48,7 +48,7 @@ public class AnsjEngine implements TokenizerEngine {
|
||||
|
||||
@Override
|
||||
public Result parse(final CharSequence text) {
|
||||
return new AnsjResult(analysis.parseStr(StrUtil.str(text)));
|
||||
return new AnsjResult(analysis.parseStr(StrUtil.toStringOrEmpty(text)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ public class HanLPEngine implements TokenizerEngine {
|
||||
|
||||
@Override
|
||||
public Result parse(final CharSequence text) {
|
||||
return new HanLPResult(this.seg.seg(StrUtil.str(text)));
|
||||
return new HanLPResult(this.seg.seg(StrUtil.toStringOrEmpty(text)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public class JcsegEngine implements TokenizerEngine {
|
||||
// 依据给定的ADictionary和SegmenterConfig来创建ISegment
|
||||
final ISegment segment = ISegment.COMPLEX.factory.create(config, dic);
|
||||
try {
|
||||
segment.reset(new StringReader(StrUtil.str(text)));
|
||||
segment.reset(new StringReader(StrUtil.toStringOrEmpty(text)));
|
||||
} catch (final IOException e) {
|
||||
throw new TokenizerException(e);
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ public class JiebaEngine implements TokenizerEngine {
|
||||
|
||||
@Override
|
||||
public Result parse(final CharSequence text) {
|
||||
return new JiebaResult(jiebaSegmenter.process(StrUtil.str(text), mode));
|
||||
return new JiebaResult(jiebaSegmenter.process(StrUtil.toStringOrEmpty(text), mode));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ public class MynlpEngine implements TokenizerEngine {
|
||||
|
||||
@Override
|
||||
public Result parse(final CharSequence text) {
|
||||
final Sentence sentence = this.lexer.scan(StrUtil.str(text));
|
||||
final Sentence sentence = this.lexer.scan(StrUtil.toStringOrEmpty(text));
|
||||
return new MynlpResult(sentence);
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@ public class WordEngine implements TokenizerEngine {
|
||||
|
||||
@Override
|
||||
public Result parse(final CharSequence text) {
|
||||
return new WordResult(this.segmentation.seg(StrUtil.str(text)));
|
||||
return new WordResult(this.segmentation.seg(StrUtil.toStringOrEmpty(text)));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user