예제 #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
        /// <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();
        }