Skip to content

Commit

Permalink
Merge pull request #98 from messai-engineering/YugaV69
Browse files Browse the repository at this point in the history
YugaV69 || OOM fix
  • Loading branch information
sonali-anand-tc authored Aug 21, 2024
2 parents 1d59160 + f4ebb8a commit 6bbc570
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>in.messai</groupId>
<artifactId>yuga</artifactId>
<version>1.0.68</version>
<version>1.0.69</version>

<name>Yuga Date Parser</name>
<description>
Expand Down Expand Up @@ -188,7 +188,7 @@
<developerConnection>scm:git:[email protected]:messai-engineering/Yuga.git</developerConnection>
<url>https://github.com/messai-engineering/Yuga</url>

<tag>yuga-1.0.68</tag>
<tag>yuga-1.0.69</tag>

</scm>
</project>
16 changes: 1 addition & 15 deletions src/main/java/com/twelfthmile/yuga/Yuga.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ else if (c == Constants.CH_FSTP && (insi = YugaMethods.lookAheadForInstr(str, i)
}
break;
case 12:
// TODO : Support 13999,1st
if (Util.isNumber(c)) {
// case like "729 613 is your Instagram code" Where the num was captured as AMT.
if((i>2 && str.charAt(i-1)==Constants.CH_SPACE && Util.isNumber(str.charAt(i-2))) || delimiterStack.pop() == Constants.CH_SLSH)
Expand All @@ -468,9 +469,6 @@ else if (c == Constants.CH_FSTP && (insi = YugaMethods.lookAheadForInstr(str, i)
if(map.contains("NUM"));
counter = map.get("NUM").length();
state=15;
} else if(delimiterStack.pop() == Constants.CH_COMA && checkForAlphaAfterComma(str, i)) {
i = counter - 1;
state = -1;
}
else {
map.setType(Constants.TY_AMT, Constants.TY_AMT);
Expand Down Expand Up @@ -1488,18 +1486,6 @@ private static int skip(String str) {
return i;
}

private static boolean checkForAlphaAfterComma(String str, int i) {
while(i >= 0 && i < str.length()) {
char c = str.charAt(i);
if(Util.isDelimiter(c)) {
break;
} else if(Util.isAlpha(c))
return true;
i++;
}
return false;
}

private static int accAmtNumPct(String str, int i, FsaContextMap map, Map<String, String> config) {
//acc num amt pct
Pair<Integer, String> p;
Expand Down
10 changes: 0 additions & 10 deletions src/test/resources/yuga_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1507,16 +1507,6 @@
},
"accepted": true
},
{
"input": "13999,1st",
"response": {
"type": "NUM",
"valMap":{"num_class":"NUM"},
"str":"13999",
"index": 5
},
"accepted": true
},
{
"input": "100.0/30 mins",
"response": {
Expand Down

0 comments on commit 6bbc570

Please sign in to comment.