示例#1
0
 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
        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);
     }
 }