Exemplo n.º 1
0
        public Span[] SentPosDetect(string paragraph)
        {
            var                bin       = GetFileStream("en-sent.bin");
            SentenceModel      model     = new SentenceModel(bin);
            SentenceDetectorME sdetector = new SentenceDetectorME(model);

            Span[] sentences = sdetector.sentPosDetect(paragraph);

            bin.close();

            return(sentences);
        }
Exemplo n.º 2
0
 public virtual Span[] SplitSentences(string line)
 {
     lock (this)
     {
         if (sentenceSplitter != null)
         {
             return(sentenceSplitter.sentPosDetect(line));
         }
         else
         {
             Span[] shorty = new Span[1];
             shorty[0] = new Span(0, line.Length);
             return(shorty);
         }
     }
 }
Exemplo n.º 3
0
 public virtual Span[] SplitSentences(string line)
 {
     UninterruptableMonitor.Enter(this);
     try
     {
         if (sentenceSplitter != null)
         {
             return(sentenceSplitter.sentPosDetect(line));
         }
         else
         {
             Span[] shorty = new Span[1];
             shorty[0] = new Span(0, line.Length);
             return(shorty);
         }
     }
     finally
     {
         UninterruptableMonitor.Exit(this);
     }
 }