Exemplo n.º 1
0
        public NGramString(string json)
        {
            NGramSetJsonCombos jsonObj = UnityEngine.JsonUtility.FromJson <NGramSetJsonCombos>(json);

            foreach (NGramSet set in jsonObj.sets)
            {
                m_combos.Add(set.before, set);
            }
        }
Exemplo n.º 2
0
        public string ToJson()
        {
            List <NGramSet> arr = new List <NGramSet>();

            foreach (NGramSet set in m_combos.Values)
            {
                arr.Add(set);
            }

            NGramSetJsonCombos jsonObj = new NGramSetJsonCombos();

            jsonObj.sets = arr;

            return(UnityEngine.JsonUtility.ToJson(jsonObj));
        }