Skip to content

Commit

Permalink
YugaV66 || SIIOB changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sonali-anand-tc committed May 7, 2024
1 parent 067d243 commit 72500ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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.65</version>
<version>1.0.66</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.65</tag>
<tag>yuga-1.0.66</tag>

</scm>
</project>
10 changes: 5 additions & 5 deletions src/main/java/com/twelfthmile/yuga/Yuga.java
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ else if ((p = Util.checkTypes(getRoot(), "FSA_DAYSFFX", str.substring(i))) != nu
}

int j = i + skip(str.substring(i));
if(j<str.length()) {
if(j >= 0 && j < str.length()) {
if ((str.charAt(j) == 'k' || str.charAt(j) == 'm' || str.charAt(j) == 'g') && (j + 1) < str.length() && str.charAt(j + 1) == 'b') {
checkIfData(str, j, map);
i = j + 2;
Expand Down Expand Up @@ -1183,7 +1183,7 @@ else if (str.charAt(j) == 'x' && ((j + 1) == str.length() || ((j + 1) < str.leng
// IL-748
boolean containsStartBracket = k < str.length() && str.substring(i,k).contains("{") || str.substring(i,k).contains("[") || str.substring(i,k).contains("(");
// Added last char is not space check that prevents 'num' becoming a 'str'. Ex: "+919057235089 pin"
if(k < str.length() && ((str.charAt(k) == 'k' || str.charAt(k) == 'm' || str.charAt(k) == 'g') && (k + 1) < str.length() && str.charAt(k + 1) == 'b')) {
if((k >= 0 && k < str.length()) && ((str.charAt(k) == 'k' || str.charAt(k) == 'm' || str.charAt(k) == 'g') && (k + 1) < str.length() && str.charAt(k + 1) == 'b')) {
checkIfData(str, k, map);
i = k + 2;
} else if(map.get("NUM").length()<3 && k+3 < str.length() && str.substring(k,k+3).equalsIgnoreCase("min")){
Expand All @@ -1199,7 +1199,7 @@ else if (str.charAt(j) == 'x' && ((j + 1) == str.length() || ((j + 1) < str.leng
map.put("type","km");
i = k+3;
}
else if (i < str.length() && str.charAt(i-1)!=' ' && Character.isAlphabetic(str.charAt(i)) && (!config.containsKey(Constants.YUGA_SOURCE_CONTEXT)||(!Constants.YUGA_SC_CURR.equals(config.get(Constants.YUGA_SOURCE_CONTEXT))&&!Constants.YUGA_SC_TRANSID.equals(config.get(Constants.YUGA_SOURCE_CONTEXT))))) {
else if (i >= 0 && i < str.length() && str.charAt(i-1)!=' ' && Character.isAlphabetic(str.charAt(i)) && (!config.containsKey(Constants.YUGA_SOURCE_CONTEXT)||(!Constants.YUGA_SC_CURR.equals(config.get(Constants.YUGA_SOURCE_CONTEXT))&&!Constants.YUGA_SC_TRANSID.equals(config.get(Constants.YUGA_SOURCE_CONTEXT))))) {
int j = i;
while (j < str.length() && str.charAt(j) != ' ')
j++;
Expand Down Expand Up @@ -1261,7 +1261,7 @@ else if(config.containsKey(Constants.YUGA_SOURCE_CONTEXT) && config.get(Constant
Pair<Integer, String> pTime;
int in = i + skip(str.substring(i));
String sub = str.substring(in);
if (in < str.length()) {
if (in >= 0 && in < str.length()) {
if (Util.isNumber(str.charAt(in)) || Util.checkTypes(getRoot(), "FSA_MONTHS", sub) != null || Util.checkTypes(getRoot(), "FSA_DAYS", sub) != null) {
Pair<Integer, FsaContextMap> p_ = parseInternal(sub, config);
// on 2021-10-27 10.54.50
Expand Down Expand Up @@ -1489,7 +1489,7 @@ private static int skip(String str) {
}

private static boolean checkForAlphaAfterComma(String str, int i) {
while(i < str.length()) {
while(i >= 0 && i < str.length()) {
char c = str.charAt(i);
if(Util.isDelimiter(c)) {
break;
Expand Down

0 comments on commit 72500ed

Please sign in to comment.