gpt4 book ai didi

edu.stanford.nlp.process.WordToSentenceProcessor.stringToNewlineIsSentenceBreak()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 23:15:05 32 4
gpt4 key购买 nike

本文整理了Java中edu.stanford.nlp.process.WordToSentenceProcessor.stringToNewlineIsSentenceBreak()方法的一些代码示例,展示了WordToSentenceProcessor.stringToNewlineIsSentenceBreak()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordToSentenceProcessor.stringToNewlineIsSentenceBreak()方法的具体详情如下:
包路径:edu.stanford.nlp.process.WordToSentenceProcessor
类名称:WordToSentenceProcessor
方法名:stringToNewlineIsSentenceBreak

WordToSentenceProcessor.stringToNewlineIsSentenceBreak介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

private static String computeExtraOptions(Properties properties) {
 String extraOptions = null;
 boolean keepNewline = Boolean.valueOf(properties.getProperty(StanfordCoreNLP.NEWLINE_SPLITTER_PROPERTY, "false")); // ssplit.eolonly
 String hasSsplit = properties.getProperty("annotators");
 if (hasSsplit != null && hasSsplit.contains(StanfordCoreNLP.STANFORD_SSPLIT)) { // ssplit
  // Only possibly put in *NL* if not all one (the Boolean method treats null as false)
  if ( ! Boolean.parseBoolean(properties.getProperty("ssplit.isOneSentence"))) {
   // Set to { NEVER, ALWAYS, TWO_CONSECUTIVE } based on  ssplit.newlineIsSentenceBreak
   String nlsbString = properties.getProperty(StanfordCoreNLP.NEWLINE_IS_SENTENCE_BREAK_PROPERTY,
     StanfordCoreNLP.DEFAULT_NEWLINE_IS_SENTENCE_BREAK);
   WordToSentenceProcessor.NewlineIsSentenceBreak nlsb = WordToSentenceProcessor.stringToNewlineIsSentenceBreak(nlsbString);
   if (nlsb != WordToSentenceProcessor.NewlineIsSentenceBreak.NEVER) {
    keepNewline = true;
   }
  }
 }
 if (keepNewline) {
  extraOptions = KEEP_NL_OPTION;
 }
 return extraOptions;
}

代码示例来源:origin: stanfordnlp/CoreNLP

public WordsToSentencesAnnotator(boolean verbose, String boundaryTokenRegex,
                 Set<String> boundaryToDiscard, Set<String> htmlElementsToDiscard,
                 String newlineIsSentenceBreak, String boundaryMultiTokenRegex,
                 Set<String> tokenRegexesToDiscard) {
 this(verbose, false,
     new WordToSentenceProcessor<>(boundaryTokenRegex, null,
         boundaryToDiscard, htmlElementsToDiscard,
         WordToSentenceProcessor.stringToNewlineIsSentenceBreak(newlineIsSentenceBreak),
         (boundaryMultiTokenRegex != null) ? TokenSequencePattern.compile(boundaryMultiTokenRegex) : null, tokenRegexesToDiscard));
}

代码示例来源:origin: stanfordnlp/CoreNLP

this.wts = new WordToSentenceProcessor<>(boundaryTokenRegex, boundaryFollowersRegex,
  boundariesToDiscard, htmlElementsToDiscard,
  WordToSentenceProcessor.stringToNewlineIsSentenceBreak(nlsb),
  (boundaryMultiTokenRegex != null) ? TokenSequencePattern.compile(boundaryMultiTokenRegex) : null, tokenRegexesToDiscard);

代码示例来源:origin: com.guokr/stan-cn-com

public WordsToSentencesAnnotator(boolean verbose, String boundaryTokenRegex,
                 Set<String> boundaryToDiscard, Set<String> htmlElementsToDiscard,
                 String newlineIsSentenceBreak) {
 this(verbose, false,
    new WordToSentenceProcessor<CoreLabel>(boundaryTokenRegex,
        boundaryToDiscard, htmlElementsToDiscard,
        WordToSentenceProcessor.stringToNewlineIsSentenceBreak(newlineIsSentenceBreak)));
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

private static String computeExtraOptions(Properties properties) {
 String extraOptions = null;
 boolean keepNewline = Boolean.valueOf(properties.getProperty(StanfordCoreNLP.NEWLINE_SPLITTER_PROPERTY, "false")); // ssplit.eolonly
 String hasSsplit = properties.getProperty("annotators");
 if (hasSsplit != null && hasSsplit.contains(StanfordCoreNLP.STANFORD_SSPLIT)) { // ssplit
  // Only possibly put in *NL* if not all one (the Boolean method treats null as false)
  if ( ! Boolean.parseBoolean(properties.getProperty("ssplit.isOneSentence"))) {
   // Set to { NEVER, ALWAYS, TWO_CONSECUTIVE } based on  ssplit.newlineIsSentenceBreak
   String nlsbString = properties.getProperty(StanfordCoreNLP.NEWLINE_IS_SENTENCE_BREAK_PROPERTY,
     StanfordCoreNLP.DEFAULT_NEWLINE_IS_SENTENCE_BREAK);
   WordToSentenceProcessor.NewlineIsSentenceBreak nlsb = WordToSentenceProcessor.stringToNewlineIsSentenceBreak(nlsbString);
   if (nlsb != WordToSentenceProcessor.NewlineIsSentenceBreak.NEVER) {
    keepNewline = true;
   }
  }
 }
 if (keepNewline) {
  extraOptions = "tokenizeNLs,";
 }
 return extraOptions;
}

代码示例来源:origin: com.guokr/stan-cn-com

public WordsToSentencesAnnotator(boolean verbose, String boundaryTokenRegex,
                 Set<String> boundaryToDiscard, Set<String> htmlElementsToDiscard,
                 String newlineIsSentenceBreak, String boundaryMultiTokenRegex,
                 Set<String> tokenRegexesToDiscard) {
 this(verbose, false,
     new WordToSentenceProcessor<CoreLabel>(boundaryTokenRegex,
         boundaryToDiscard, htmlElementsToDiscard,
         WordToSentenceProcessor.stringToNewlineIsSentenceBreak(newlineIsSentenceBreak),
         (boundaryMultiTokenRegex != null)? TokenSequencePattern.compile(boundaryMultiTokenRegex):null, tokenRegexesToDiscard));
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

public WordsToSentencesAnnotator(boolean verbose, String boundaryTokenRegex,
                 Set<String> boundaryToDiscard, Set<String> htmlElementsToDiscard,
                 String newlineIsSentenceBreak, String boundaryMultiTokenRegex,
                 Set<String> tokenRegexesToDiscard) {
 this(verbose, false,
     new WordToSentenceProcessor<>(boundaryTokenRegex, null,
         boundaryToDiscard, htmlElementsToDiscard,
         WordToSentenceProcessor.stringToNewlineIsSentenceBreak(newlineIsSentenceBreak),
         (boundaryMultiTokenRegex != null) ? TokenSequencePattern.compile(boundaryMultiTokenRegex) : null, tokenRegexesToDiscard));
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

this.wts = new WordToSentenceProcessor<>(boundaryTokenRegex, boundaryFollowersRegex,
  boundariesToDiscard, htmlElementsToDiscard,
  WordToSentenceProcessor.stringToNewlineIsSentenceBreak(nlsb),
  (boundaryMultiTokenRegex != null) ? TokenSequencePattern.compile(boundaryMultiTokenRegex) : null, tokenRegexesToDiscard);

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com