Exemplo n.º 1
0
        private void test()
        {
            //parse obj from string
            string txt = "言葉 ことば  (NGÔN DIỆP) Câu nói";
            //txt = "積極 せいこう (THÀNH CÔNG)";
            //txt = "心配 (TÂM PHỐI)";
            word w = new word(txt);

            txt = w.ToString();
        }
Exemplo n.º 2
0
        //for test
        public List <word> parse(string text)
        {
            var words = new List <word>();
            var lines = text.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in lines)
            {
                var word = new word(line);
                if (!word.isEmpty)
                {
                    words.Add(word);
                }
            }
            return(words);
        }
Exemplo n.º 3
0
        //txt: words list
        //
        public async Task <int> saveChapter(string text)
        {
            //clear cur content data
            var words = new List <word>();
            var lines = text.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in lines)
            {
                var word = new word(line);
                if (!word.isEmpty)
                {
                    words.Add(word);
                }
            }
            m_content.m_words = words;
            Debug.WriteLine("{0} {1} {2}", this, "saveChapter", words.Count);
            int ret = await m_content.saveData();

            return(ret);
        }