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; } }
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 } }
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); } }