示例#1
0
        /// <summary> Initializes the Chart-based Morphological Analyzer plug-in.</summary>
        /// <param name="baseDir">- the path for base directory, which should have the 'conf' and 'data' directory
        /// </param>
        /// <param name="configFile">- the path for the configuration file (relative path to the base directory)
        /// </param>
        public virtual void  initialize(System.String baseDir, System.String configFile)
        {
            JSONReader json = new JSONReader(configFile);

            fileDicSystem      = baseDir + "/" + json.getValue("dic_system");
            fileDicUser        = baseDir + "/" + json.getValue("dic_user");
            fileConnections    = baseDir + "/" + json.getValue("connections");
            fileConnectionsNot = baseDir + "/" + json.getValue("connections_not");
            fileDicAnalyzed    = baseDir + "/" + json.getValue("dic_analyzed");
            fileTagSet         = baseDir + "/" + json.getValue("tagset");

            tagSet = new TagSet();
            tagSet.init(fileTagSet, TagSet.TAG_SET_KAIST);

            connection = new Connection();
            connection.init(fileConnections, tagSet.TagCount, tagSet);

            connectionNot = new ConnectionNot();
            connectionNot.init(fileConnectionsNot, tagSet);

            analyzedDic = new AnalyzedDic();
            analyzedDic.readDic(fileDicAnalyzed);

            systemDic = new Trie(Trie.DEFAULT_TRIE_BUF_SIZE_SYS);
            systemDic.read_dic(fileDicSystem, tagSet);

            userDic = new Trie(Trie.DEFAULT_TRIE_BUF_SIZE_USER);
            userDic.read_dic(fileDicUser, tagSet);

            numDic = new NumberDic();
            simti  = new Simti();
            simti.init();
            eojeolList = new LinkedList <Eojeol>();

            chart = new MorphemeChart(tagSet, connection, systemDic, userDic, numDic, simti, eojeolList);

            postProc = new PostProcessor();
        }
示例#2
0
 public Morpheme(MorphemeChart enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
示例#3
0
 private void  InitBlock(MorphemeChart enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     connection             = new int[kr.ac.kaist.swrc.jhannanum.plugin.MajorPlugin.MorphAnalyzer.ChartMorphAnalyzer.MorphemeChart.MAX_MORPHEME_CONNECTION];
 }
示例#4
0
 /// <summary> Constructor.</summary>
 /// <param name="mc">- the lattice style morpheme chart
 /// </param>
 /// <param name="tagSet">- morpheme tag set
 /// </param>
 public Exp(MorphemeChart mc, TagSet tagSet)
 {
     this.mc = mc;
     this.tagSet = tagSet;
     pset_end = pset.Length;
 }
        /// <summary> Initializes the Chart-based Morphological Analyzer plug-in.</summary>
        /// <param name="baseDir">- the path for base directory, which should have the 'conf' and 'data' directory
        /// </param>
        /// <param name="configFile">- the path for the configuration file (relative path to the base directory)
        /// </param>
        public virtual void initialize(System.String baseDir, System.String configFile)
        {
            JSONReader json = new JSONReader(configFile);

            fileDicSystem = baseDir + "/" + json.getValue("dic_system");
            fileDicUser = baseDir + "/" + json.getValue("dic_user");
            fileConnections = baseDir + "/" + json.getValue("connections");
            fileConnectionsNot = baseDir + "/" + json.getValue("connections_not");
            fileDicAnalyzed = baseDir + "/" + json.getValue("dic_analyzed");
            fileTagSet = baseDir + "/" + json.getValue("tagset");

            tagSet = new TagSet();
            tagSet.init(fileTagSet, TagSet.TAG_SET_KAIST);

            connection = new Connection();
            connection.init(fileConnections, tagSet.TagCount, tagSet);

            connectionNot = new ConnectionNot();
            connectionNot.init(fileConnectionsNot, tagSet);

            analyzedDic = new AnalyzedDic();
            analyzedDic.readDic(fileDicAnalyzed);

            systemDic = new Trie(Trie.DEFAULT_TRIE_BUF_SIZE_SYS);
            systemDic.read_dic(fileDicSystem, tagSet);

            userDic = new Trie(Trie.DEFAULT_TRIE_BUF_SIZE_USER);
            userDic.read_dic(fileDicUser, tagSet);

            numDic = new NumberDic();
            simti = new Simti();
            simti.init();
            eojeolList = new LinkedList < Eojeol >();

            chart = new MorphemeChart(tagSet, connection, systemDic, userDic, numDic, simti, eojeolList);

            postProc = new PostProcessor();
        }
示例#6
0
 private void InitBlock(MorphemeChart enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     connection = new int[kr.ac.kaist.swrc.jhannanum.plugin.MajorPlugin.MorphAnalyzer.ChartMorphAnalyzer.MorphemeChart.MAX_MORPHEME_CONNECTION];
 }
示例#7
0
 public Morpheme(MorphemeChart enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
示例#8
0
 /// <summary> Constructor.</summary>
 /// <param name="mc">- the lattice style morpheme chart
 /// </param>
 /// <param name="tagSet">- morpheme tag set
 /// </param>
 public Exp(MorphemeChart mc, TagSet tagSet)
 {
     this.mc     = mc;
     this.tagSet = tagSet;
     pset_end    = pset.Length;
 }