Beispiel #1
0
 /// <summary>
 /// Detects the sentences in the specified input.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <param name="detector">The detector.</param>
 /// <returns>The sentences.</returns>
 public Sentence[] Detect(Token[] input, SentenceDetectorLanguage detector)
 {
     if (!Detectors.ContainsKey(detector))
     {
         return(Array.Empty <Sentence>());
     }
     return(Detectors[detector].DetectSentences(input));
 }
Beispiel #2
0
 /// <summary>
 /// Withes the specified sentence detector.
 /// </summary>
 /// <param name="sentenceDetector">The sentence detector.</param>
 /// <returns>This.</returns>
 /// <exception cref="ArgumentNullException">sentenceDetector</exception>
 public Pipeline With(SentenceDetectorLanguage sentenceDetector)
 {
     SentenceDetectorLanguage = sentenceDetector ?? throw new ArgumentNullException(nameof(sentenceDetector));
     return(this);
 }
Beispiel #3
0
 /// <summary>
 /// Detects the sentences in the specified input.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <param name="detector">The detector.</param>
 /// <returns>The sentences.</returns>
 public Sentence[] Detect(string input, SentenceDetectorLanguage detector)
 {
     return(Detect(Tokenizer.Tokenize(input, TokenizerLanguage.EnglishRuleBased), detector));
 }