构造初始化成员变量声明为 final;

This commit is contained in:
Magese 2021-12-31 17:35:32 +08:00
parent ab50f161e6
commit 020f83e665
1 changed files with 16 additions and 6 deletions

View File

@ -41,15 +41,25 @@ import java.util.List;
*/ */
public final class IKSegmenter { public final class IKSegmenter {
// 字符窜reader /**
* 字符窜reader
*/
private Reader input; private Reader input;
// 分词器配置项 /**
private Configuration cfg; * 分词器配置项
// 分词器上下文 */
private final Configuration cfg;
/**
* 分词器上下文
*/
private AnalyzeContext context; private AnalyzeContext context;
// 分词处理器列表 /**
* 分词处理器列表
*/
private List<ISegmenter> segmenters; private List<ISegmenter> segmenters;
// 分词歧义裁决器 /**
* 分词歧义裁决器
*/
private IKArbitrator arbitrator; private IKArbitrator arbitrator;