Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

Commit

Permalink
There can be more than one space as well
Browse files Browse the repository at this point in the history
  • Loading branch information
trivedigaurav committed Jul 17, 2015
1 parent be56559 commit a17a617
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@ protected String getStartEndPosition(String docID, Map<String,String> spanMap) t
String fn_pathology = Storage_Controller.getPathologyReportFn();
String docText;
Pattern pattern = getSearchPatternFromSpanMap(spanMap);
System.out.println(pattern);
Matcher m;
// search text in colonoscopy text, remove header footer
// docText = Preprocess.separateReportHeaderFooter(
Expand Down Expand Up @@ -939,6 +940,8 @@ public String wordTreeSkippedNGramPatternString(Map<String, String> spanMap)
String[] matchedTokenList = TextUtil.escapeRegex(spanMap.get("matched")).split(" ");


System.out.println("Received span map: " + spanMap);

StringBuilder sb = new StringBuilder();
// matchedTokenList.length >= selectedTokenList.length
int skippedN = 0;
Expand Down Expand Up @@ -978,7 +981,7 @@ public String wordTreeSkippedNGramPatternString(Map<String, String> spanMap)
patternStr = sb.toString().trim().replaceAll(whiteSpaceBeforePunc, "\\\\s{0,1}");
// in case the first skipped n-gram is a punctuation
// there would be no white space before the n-gram
patternStr = patternStr.replaceAll(" (?=(\\(\\\\S\\+))", "\\\\s{0,1}");
patternStr = patternStr.replaceAll(" (?=(\\(\\\\S\\+))", "\\\\s*");
// // quote the string
// patternStr = TextUtil.escapeRegex(patternStr);
// reverse 's
Expand Down

0 comments on commit a17a617

Please sign in to comment.