de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange类的一些代码示例,展示了YearsRange类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearsRange类的具体详情如下:
包路径:de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange
类名称:YearsRange

YearsRange介绍

[英]Years period in the quotation phrase / sentence.
[中]引语短语/句子中的年周期。

代码示例

代码示例来源:origin: dkpro/dkpro-jwktl

/** Parses source text (e.g. "1882" or "08-07-2011" or "06.05.2006") 
 * and extracts four digits.
 * 
 * @return -1 If text was not parsed successfully
 */
private int extractFourDigits (String page_title, String text) {
  
  int i = -1;
  
  Matcher m = pattern_contains_4_year.matcher(text);
  if(m.find()) {
    text = m.group();
    i = stringToInt(page_title, text);
  }
  return i;
}

代码示例来源:origin: de.tudarmstadt.ukp.jwktl/jwktl

text = text.substring(0, text.length() - 1);
if(   containsTwoNonAdjacentSymbols (page_title, text, '-') // "08-07-2011"
  || containsTwoNonAdjacentSymbols (page_title, text, '.') // "06.05.2006"
 ) {
  year_to = year_from = extractFourDigits(page_title, text);
  return;
  year_from = stringToInt(page_title, text);
  year_to = year_from;
} else {
    year_from = stringToInt(page_title, str_from);
    year_to = year_from;
    year_to = stringToInt(page_title, str_to);

代码示例来源:origin: de.tudarmstadt.ukp.jwktl/jwktl

YearsRange years_range = new YearsRange();
        title_and_wikilink.parseTitle(p); break;
      case 4:
        years_range.parseYearsRange(page_title, p.trim());
        break;
      publisher = value;
    } else if(param_name.equalsIgnoreCase("дата")) {
      years_range.parseYearsRange(page_title, value.trim());
    } else if(param_name.equalsIgnoreCase("источник")) {
      source = value;

代码示例来源:origin: dkpro/dkpro-jwktl

text = text.substring(0, text.length() - 1);
if(   containsTwoNonAdjacentSymbols (page_title, text, '-') // "08-07-2011"
  || containsTwoNonAdjacentSymbols (page_title, text, '.') // "06.05.2006"
 ) {
  year_to = year_from = extractFourDigits(page_title, text);
  return;
  year_from = stringToInt(page_title, text);
  year_to = year_from;
} else {
    year_from = stringToInt(page_title, str_from);
    year_to = year_from;
    year_to = stringToInt(page_title, str_to);

代码示例来源:origin: dkpro/dkpro-jwktl

YearsRange years_range = new YearsRange();
        title_and_wikilink.parseTitle(p); break;
      case 4:
        years_range.parseYearsRange(page_title, p.trim());
        break;
      publisher = value;
    } else if(param_name.equalsIgnoreCase("дата")) {
      years_range.parseYearsRange(page_title, value.trim());
    } else if(param_name.equalsIgnoreCase("источник")) {
      source = value;

代码示例来源:origin: de.tudarmstadt.ukp.jwktl/jwktl

/** Parses source text (e.g. "1882" or "08-07-2011" or "06.05.2006") 
 * and extracts four digits.
 * 
 * @return -1 If text was not parsed successfully
 */
private int extractFourDigits (String page_title, String text) {
  
  int i = -1;
  
  Matcher m = pattern_contains_4_year.matcher(text);
  if(m.find()) {
    text = m.group();
    i = stringToInt(page_title, text);
  }
  return i;
}

相关文章