/// <summary> /// 获取出版日期 /// </summary> /// <returns></returns> public void ExtractPublishDate() { foreach (var item in this.Sentences) { if (TextHandleTool.IsFindPublishDate(item)) { PublishDate = TextHandleTool.GetPublishDate(item); break; } } }
private void ExtractDOI() { //获取DOI int i = 0; foreach (var item in this.Sentences) { if (TextHandleTool.IsFindDoi(item)) { DOI = TextHandleTool.GetDoi(item, i, this.Sentences); break; } i++; } }
private void ExtractKeywords() { //获取关键字,如有Introduction或者1. Introduction,获取之间的语句,否则获取keywords所在行 int start = 0; int end = 0; int i = 0; foreach (var item in this.Sentences) { i++; var lowerItem = item.ToLower(); if (start == 0) { if (lowerItem.StartsWith("keywords") || lowerItem.StartsWith("key words:")) { start = i; } } if (end == 0) { if (Regex.IsMatch(item, TextHandleTool.Introductionpattern, RegexOptions.IgnoreCase)) { end = i; } } if (end == 0 && item.ToUpper().Trim('\r').Trim() == "CONTENTS") { end = i; } if (start > 0 && end > 0 && end > start) { break; } } StringBuilder keywords = new StringBuilder(); if (start > 0) { for (int j = start - 1; j < end - 1; j++) { if (Regex.IsMatch(Sentences[j], @"\d+")) { break; } keywords.Append(Sentences[j]); } } this.Keywords = keywords.ToString(); if (this.Keywords == "") { foreach (var item in Sentences) { if (TextHandleTool.IsFindKeywords(item)) { Keywords = TextHandleTool.GetKeyWords(item); break; } } } }
public void ExtractISSN() { ISSN = TextHandleTool.GetISSN(this.Text); }