示例#1
0
 /// <summary>
 /// Dispose.
 /// </summary>
 protected virtual void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         _disposed = true;
         Interlocked.MemoryBarrier();
         GrammarApi.sol_DeleteSentenceBroker(_hObject);
     }
 }
示例#2
0
        public List <string> SplitSentences(string input)
        {
            var broker = GrammarApi.sol_CreateSentenceBrokerMemW(_engine, input, (int)Languages.RUSSIAN_LANGUAGE);
            var result = new List <string>();

            int len;

            while ((len = GrammarApi.sol_FetchSentence(broker)) >= 0)
            {
                if (len > 0)
                {
                    var b = new StringBuilder(len + 2);
                    GrammarApi.sol_GetFetchedSentence(broker, b);
                    result.Add(b.ToString());
                }
            }

            GrammarApi.sol_DeleteSentenceBroker(broker);

            return(result);
        }