Пример #1
0
        //struct StemItem { public PutTypes type; public string word; }

        static void wordBreak(string text, IWordBreaker breaker, Action <PutTypes, int, int> onPutWord)
        {
            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            BreakSink   cws         = new BreakSink(onPutWord);
            TEXT_SOURCE pTextSource = new TEXT_SOURCE();

            pTextSource.pfnFillTextBuffer += fillTextBuffer;
            pTextSource.awcBuffer          = text;
            pTextSource.iCur = 0;
            pTextSource.iEnd = text.Length;
            breaker.BreakText(ref pTextSource, cws, /*cps*/ null);
        }
Пример #2
0
 static uint fillTextBuffer(ref TEXT_SOURCE ts)
 {
     return(WBREAK_E_END_OF_TEXT);
 }