예제 #1
0
파일: LexTo.cs 프로젝트: Onchulee/ThaiText
 public void Load(byte[] data)
 {
     if (data != null && data.Length > 0)
     {
         using (StreamReader sr = new StreamReader(new MemoryStream(data)))
         {
             Tokenizer = new LongLexTo(sr);
         }
         Debug.Log(" !!! LexTo Initialized ");
         init = true;
     }
 }
예제 #2
0
파일: LexTo.cs 프로젝트: Onchulee/ThaiText
        private LexTo()
        {
            // Try loading lexitron dictionary from a Resources folder in the user project.
            TryInitialize();

            if(!init)
            {
                Tokenizer = new LongLexTo();
#if !UNITY_EDITOR
                Debug.LogError(" !!! Error: The dictionary file is not found, " + Lexitron.FileName);
#endif
            }
        }
예제 #3
0
 private LexTo()
 {
     TextAsset level = Resources.Load<TextAsset>(dictionaryName);
     if (level != null)
     {
         using (StreamReader sr = new StreamReader(new MemoryStream(level.bytes)))
         {
             Tokenizer = new LongLexTo(sr);
         }
         Debug.Log(" !!! LexTo Initialized ");
         init = true;
     }
     else {
         Tokenizer = new LongLexTo();
         init = false;
         Debug.LogError(" !!! Error: The dictionary file is not found, " + dictionaryName);
     }
 }