Exemplo n.º 1
0
        public List <Word> GetWordsInfo()
        {
            // null check
            if (string.IsNullOrEmpty(_sourceString) && (_words == null || _words.Count == 0))
            {
                return(new List <Word>());
            }

            var tempFileName = Path.GetTempFileName();

            if (string.IsNullOrEmpty(_sourceString))
            {
                var inputString = string.Join(" ", _words);
                File.WriteAllText(tempFileName, inputString);
            }
            else
            {
                File.WriteAllText(tempFileName, _sourceString);
            }

            var mystemWrapper = new MystemWrapper();
            var result        = mystemWrapper.GetFullInfo(tempFileName);

            File.Delete(tempFileName);
            return(result);
        }
Exemplo n.º 2
0
        public List<Word> GetWordsInfo()
        {
            // null check
            if (string.IsNullOrEmpty(_sourceString) && (_words == null || _words.Count == 0))
                return new List<Word>();

            var tempFileName = Path.GetTempFileName();
            if (string.IsNullOrEmpty(_sourceString))
            {
                var inputString = string.Join(" ", _words);
                File.WriteAllText(tempFileName, inputString);
            }
            else
            {
                File.WriteAllText(tempFileName, _sourceString);
            }

            var mystemWrapper = new MystemWrapper();
            var result = mystemWrapper.GetFullInfo(tempFileName);

            File.Delete(tempFileName);
            return result;
        }