Skip to content

Commit

Permalink
Merge pull request #18 from zoho/hawking_dev
Browse files Browse the repository at this point in the history
Newline and Extra space Parser label Indexing issue removed
  • Loading branch information
ArulVendhan authored Jun 16, 2021
2 parents 3847c56 + ec45dda commit 58e0c92
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.zoho</groupId>
<artifactId>hawking</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
<packaging>jar</packaging>
<name>Hawking</name>
<description>Hawking is a natural language date time parser that extracts date and time from text with context and parse to the required format.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ public List<Pair<Boolean, List<Triple<String, Integer, Integer>>>> getSeparateD
@Override
public List<DateTimeProperties> predict(String inputSentence, Date referenceDate, HawkingConfiguration config) {
List<DateTimeProperties> dateList = new ArrayList<>();
inputSentence = inputSentence.replaceAll("\n",". "); //NO I18n
List<String> inputSentences = CoreNlpUtils.sentenceTokenize(inputSentence);
for(String sent: inputSentences){
sent = sent.replaceAll("\\s{2,}", " ").trim();
List<Pair<Boolean, List<Triple<String, Integer, Integer>>>> singleDatesList = getSeparateDates(Parser.parse(sent));
for (Pair<Boolean, List<Triple<String, Integer, Integer>>> relAndDate : singleDatesList) {
List<Triple<String, Integer, Integer>> triples = relAndDate.getRight();
Expand Down

0 comments on commit 58e0c92

Please sign in to comment.