public override void LoadDictionaries()
            {
                Penalties = new List <int>();
                Penalties.Add(kanjiPenaltyLengthTreshold);
                Penalties.Add(kanjiPenalty);
                Penalties.Add(otherPenaltyLengthThreshold);
                Penalties.Add(otherPenalty);

                try
                {
                    Fst                  = FST.NewInstance(AbsoluteFolderPath);
                    ConnectionCosts      = ConnectionCosts.NewInstance(AbsoluteFolderPath);
                    TokenInfoDictionary  = TokenInfoDictionary.NewInstance(AbsoluteFolderPath);
                    CharacterDefinitions = CharacterDefinitions.NewInstance(AbsoluteFolderPath);

                    if (IsSplitOnNakaguro)
                    {
                        CharacterDefinitions.SetCategories('・', new string[] { "SYMBOL" });
                    }

                    UnknownDictionary  = UnknownDictionary.NewInstance(AbsoluteFolderPath, CharacterDefinitions, totalFeatures);
                    InsertedDictionary = new InsertedDictionary(totalFeatures);
                }
                catch (Exception ouch)
                {
                    throw new Exception("Could not load dictionaries: " + ouch.Message);
                }
            }
Example #2
0
 protected internal virtual void LoadDictionaries()
 {
     DoubleArrayTrie      = DoubleArrayTrie.NewInstance(Resolver);
     ConnectionCosts      = ConnectionCosts.NewInstance(Resolver);
     TokenInfoDictionary  = TokenInfoDictionary.NewInstance(Resolver);
     CharacterDefinitions = CharacterDefinitions.NewInstance(Resolver);
     UnknownDictionary    = UnknownDictionary.NewInstance(Resolver, CharacterDefinitions, TotalFeatures);
     InsertedDictionary   = new InsertedDictionary(TotalFeatures);
 }
Example #3
0
 public virtual void LoadDictionaries()
 {
     try
     {
         Fst                  = FST.FST.NewInstance(AbsoluteFolderPath);
         ConnectionCosts      = ConnectionCosts.NewInstance(AbsoluteFolderPath);
         TokenInfoDictionary  = TokenInfoDictionary.NewInstance(AbsoluteFolderPath);
         CharacterDefinitions = CharacterDefinitions.NewInstance(AbsoluteFolderPath);
         UnknownDictionary    = UnknownDictionary.NewInstance(AbsoluteFolderPath, CharacterDefinitions, totalFeatures);
         InsertedDictionary   = new InsertedDictionary(totalFeatures);
     }
     catch (Exception ouch)
     {
         throw new Exception("Could not load dictionaries.", ouch);
     }
 }