Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improved JSON parser

Signed-off-by: Rifat Nabi <to.rifat@gmail.com>
  • Loading branch information...
commit 1576baa7a372dcda53135abe5396282a0c0509af 1 parent 9c1acf0
@torifat authored
Showing with 113 additions and 2,817 deletions.
  1. +2 −1  AvroParser.h
  2. +110 −95 AvroParser.m
  3. +1 −2,721 data.json
View
3  AvroParser.h
@@ -11,7 +11,8 @@
NSString* _vowel;
NSString* _consonant;
NSString* _casesensitive;
- NSDictionary* _patterns;
+ NSArray* _patterns;
+ int _maxPatternLength;
}
+ (void)allocateSharedInstance;
View
205 AvroParser.m
@@ -30,6 +30,7 @@ - (id)init {
_consonant = [jsonArray objectForKey:@"consonant"];
_casesensitive = [jsonArray objectForKey:@"casesensitive"];
_patterns = [jsonArray objectForKey:@"patterns"];
+ _maxPatternLength = [[[_patterns objectAtIndex:0] objectForKey:@"find"] length];
}
} else {
@@ -87,113 +88,126 @@ - (NSString*)parse:(NSString *)string {
int start = cur, end;
BOOL matched = FALSE;
- for(NSDictionary *pattern in _patterns) {
- NSString* find = [pattern objectForKey:@"find"];
- int findLen = [find length];
- end = cur + findLen;
- int diff = (end - start);
- if(end <= len && diff == findLen) {
- NSString* chunk = [fixed substringWithRange:NSMakeRange(start, diff)];
- if(chunk && [chunk length] && [chunk isEqualToString:find]) {
- NSArray* rules = [pattern objectForKey:@"rules"];
- for(NSDictionary* rule in rules) {
-
- BOOL replace = TRUE;
- int chk = 0;
- NSArray* matches = [rule objectForKey:@"matches"];
- for(NSDictionary* match in matches) {
- NSString* value = [match objectForKey:@"value"];
- NSString* type = [match objectForKey:@"type"];
- NSString* scope = [match objectForKey:@"scope"];
- BOOL isNegative = [[match objectForKey:@"negative"] boolValue];
-
- if([type isEqualToString:@"suffix"]) {
- chk = end;
- }
- // Prefix
- else {
- chk = start - 1;
- }
+ int chunkLen;
+ for(chunkLen = _maxPatternLength; chunkLen > 0; --chunkLen) {
+ end = start + chunkLen;
+ if(end <= len) {
+ NSString* chunk = [fixed substringWithRange:NSMakeRange(start, chunkLen)];
+
+ // Binary Search
+ int left = 0, right = [_patterns count] - 1, mid;
+ while(right >= left) {
+ mid = (right + left) / 2;
+ NSDictionary* pattern = [_patterns objectAtIndex:mid];
+ NSString* find = [pattern objectForKey:@"find"];
+ if([find isEqualToString:chunk]) {
+ NSArray* rules = [pattern objectForKey:@"rules"];
+ for(NSDictionary* rule in rules) {
- // Beginning
- if([scope isEqualToString:@"punctuation"]) {
- if(
- ! (
- (chk < 0 && [type isEqualToString:@"prefix"]) ||
- (chk >= len && [type isEqualToString:@"suffix"]) ||
- [self isPunctuation:[fixed characterAtIndex:chk]]
- ) ^ isNegative
- ) {
- replace = FALSE;
- break;
- }
- }
- // Vowel
- else if([scope isEqualToString:@"vowel"]) {
- if(
- ! (
- (
- (chk >= 0 && [type isEqualToString:@"prefix"]) ||
- (chk < len && [type isEqualToString:@"suffix"])
- ) &&
- [self isVowel:[fixed characterAtIndex:chk]]
- ) ^ isNegative
- ) {
- replace = FALSE;
- break;
- }
- }
- // Consonant
- else if([scope isEqualToString:@"consonant"]) {
- if(
- ! (
- (
- (chk >= 0 && [type isEqualToString:@"prefix"]) ||
- (chk < len && [type isEqualToString:@"suffix"])
- ) &&
- [self isConsonant:[fixed characterAtIndex:chk]]
- ) ^ isNegative
- ) {
- replace = FALSE;
- break;
- }
- }
- // Exact
- else if([scope isEqualToString:@"exact"]) {
- int s, e;
+ BOOL replace = TRUE;
+ int chk = 0;
+ NSArray* matches = [rule objectForKey:@"matches"];
+ for(NSDictionary* match in matches) {
+ NSString* value = [match objectForKey:@"value"];
+ NSString* type = [match objectForKey:@"type"];
+ NSString* scope = [match objectForKey:@"scope"];
+ BOOL isNegative = [[match objectForKey:@"negative"] boolValue];
+
if([type isEqualToString:@"suffix"]) {
- s = end;
- e = end + [value length];
+ chk = end;
}
// Prefix
else {
- s = start - [value length];
- e = start;
+ chk = start - 1;
}
- if(![self isExact:value heystack:fixed start:s end:e not:isNegative]) {
- replace = FALSE;
- break;
+
+ // Beginning
+ if([scope isEqualToString:@"punctuation"]) {
+ if(
+ ! (
+ (chk < 0 && [type isEqualToString:@"prefix"]) ||
+ (chk >= len && [type isEqualToString:@"suffix"]) ||
+ [self isPunctuation:[fixed characterAtIndex:chk]]
+ ) ^ isNegative
+ ) {
+ replace = FALSE;
+ break;
+ }
}
+ // Vowel
+ else if([scope isEqualToString:@"vowel"]) {
+ if(
+ ! (
+ (
+ (chk >= 0 && [type isEqualToString:@"prefix"]) ||
+ (chk < len && [type isEqualToString:@"suffix"])
+ ) &&
+ [self isVowel:[fixed characterAtIndex:chk]]
+ ) ^ isNegative
+ ) {
+ replace = FALSE;
+ break;
+ }
+ }
+ // Consonant
+ else if([scope isEqualToString:@"consonant"]) {
+ if(
+ ! (
+ (
+ (chk >= 0 && [type isEqualToString:@"prefix"]) ||
+ (chk < len && [type isEqualToString:@"suffix"])
+ ) &&
+ [self isConsonant:[fixed characterAtIndex:chk]]
+ ) ^ isNegative
+ ) {
+ replace = FALSE;
+ break;
+ }
+ }
+ // Exact
+ else if([scope isEqualToString:@"exact"]) {
+ int s, e;
+ if([type isEqualToString:@"suffix"]) {
+ s = end;
+ e = end + [value length];
+ }
+ // Prefix
+ else {
+ s = start - [value length];
+ e = start;
+ }
+ if(![self isExact:value heystack:fixed start:s end:e not:isNegative]) {
+ replace = FALSE;
+ break;
+ }
+ }
+ }
+
+ if(replace) {
+ [output appendString:[rule objectForKey:@"replace"]];
+ cur = end - 1;
+ matched = TRUE;
+ break;
}
+
}
- if(replace) {
- [output appendString:[rule objectForKey:@"replace"]];
- cur = end - 1;
- matched = TRUE;
- break;
- }
+ if(matched == TRUE) break;
+ // Default
+ [output appendString:[pattern objectForKey:@"replace"]];
+ cur = end - 1;
+ matched = TRUE;
+ break;
+ }
+ else if ([find length] > [chunk length] ||
+ ([find length] == [chunk length] && [find compare:chunk] == NSOrderedAscending)) {
+ left = mid + 1;
+ } else {
+ right = mid - 1;
}
-
- if(matched == true) break;
-
- // Default
- [output appendString:[pattern objectForKey:@"replace"]];
- cur = end - 1;
- matched = TRUE;
- break;
}
+ if(matched == TRUE) break;
}
}
@@ -254,7 +268,8 @@ - (BOOL)isCaseSensitive:(unichar)c {
- (BOOL)isExact:(NSString*) needle heystack:(NSString*)heystack start:(int)start end:(int)end not:(BOOL)not {
// NSLog(@"Cut: %@", [heystack substringWithRange:NSMakeRange(start, end)]);
int len = end - start;
- return ((start >=0 && end < [heystack length] && [[heystack substringWithRange:NSMakeRange(start, len)] isEqualToString:needle]) ^ not);
+ return ((start >= 0 && end < [heystack length]
+ && [[heystack substringWithRange:NSMakeRange(start, len)] isEqualToString:needle]) ^ not);
}
- (unichar) smallCap:(unichar) letter {
View
2,722 data.json
@@ -1,2721 +1 @@
-{
- "patterns":
- [
- {
- "find":"bhl",
- "replace":"ভ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"bdh",
- "replace":"ব্ধ",
- "rules":
- [
- ]
- },
- {
- "find":"psh",
- "replace":"পশ",
- "rules":
- [
- ]
- },
- {
- "find":"bj",
- "replace":"ব্জ",
- "rules":
- [
- ]
- },
- {
- "find":"bd",
- "replace":"ব্দ",
- "rules":
- [
- ]
- },
- {
- "find":"bb",
- "replace":"ব্ব",
- "rules":
- [
- ]
- },
- {
- "find":"bl",
- "replace":"ব্ল",
- "rules":
- [
- ]
- },
- {
- "find":"bh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"vl",
- "replace":"ভ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"b",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"v",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"cNG",
- "replace":"চ্ঞ",
- "rules":
- [
- ]
- },
- {
- "find":"cch",
- "replace":"চ্ছ",
- "rules":
- [
- ]
- },
- {
- "find":"cc",
- "replace":"চ্চ",
- "rules":
- [
- ]
- },
- {
- "find":"ch",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"c",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"dhn",
- "replace":"ধ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"dhm",
- "replace":"ধ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"dgh",
- "replace":"দ্ঘ",
- "rules":
- [
- ]
- },
- {
- "find":"ddh",
- "replace":"দ্ধ",
- "rules":
- [
- ]
- },
- {
- "find":"dbh",
- "replace":"দ্ভ",
- "rules":
- [
- ]
- },
- {
- "find":"dv",
- "replace":"দ্ভ",
- "rules":
- [
- ]
- },
- {
- "find":"dm",
- "replace":"দ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"DD",
- "replace":"ড্ড",
- "rules":
- [
- ]
- },
- {
- "find":"Dh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"dh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"dg",
- "replace":"দ্গ",
- "rules":
- [
- ]
- },
- {
- "find":"dd",
- "replace":"দ্দ",
- "rules":
- [
- ]
- },
- {
- "find":"D",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"d",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"...",
- "replace":"...",
- "rules":
- [
- ]
- },
- {
- "find":".`",
- "replace":".",
- "rules":
- [
- ]
- },
- {
- "find":"..",
- "replace":"।।",
- "rules":
- [
- ]
- },
- {
- "find":".",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"ghn",
- "replace":"ঘ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"Ghn",
- "replace":"ঘ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"gdh",
- "replace":"গ্ধ",
- "rules":
- [
- ]
- },
- {
- "find":"Gdh",
- "replace":"গ্ধ",
- "rules":
- [
- ]
- },
- {
- "find":"gN",
- "replace":"গ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"GN",
- "replace":"গ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"gn",
- "replace":"গ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"Gn",
- "replace":"গ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"gm",
- "replace":"গ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"Gm",
- "replace":"গ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"gl",
- "replace":"গ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"Gl",
- "replace":"গ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"gg",
- "replace":"জ্ঞ",
- "rules":
- [
- ]
- },
- {
- "find":"GG",
- "replace":"জ্ঞ",
- "rules":
- [
- ]
- },
- {
- "find":"Gg",
- "replace":"জ্ঞ",
- "rules":
- [
- ]
- },
- {
- "find":"gG",
- "replace":"জ্ঞ",
- "rules":
- [
- ]
- },
- {
- "find":"gh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"Gh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"g",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"G",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"hN",
- "replace":"হ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"hn",
- "replace":"হ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"hm",
- "replace":"হ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"hl",
- "replace":"হ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"h",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"jjh",
- "replace":"জ্ঝ",
- "rules":
- [
- ]
- },
- {
- "find":"jNG",
- "replace":"জ্ঞ",
- "rules":
- [
- ]
- },
- {
- "find":"jh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"jj",
- "replace":"জ্জ",
- "rules":
- [
- ]
- },
- {
- "find":"j",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"J",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"kkhN",
- "replace":"ক্ষ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"kShN",
- "replace":"ক্ষ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"kkhm",
- "replace":"ক্ষ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"kShm",
- "replace":"ক্ষ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"kxN",
- "replace":"ক্ষ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"kxm",
- "replace":"ক্ষ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"kkh",
- "replace":"ক্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"kSh",
- "replace":"ক্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"ksh",
- "replace":"কশ",
- "rules":
- [
- ]
- },
- {
- "find":"kx",
- "replace":"ক্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"kk",
- "replace":"ক্ক",
- "rules":
- [
- ]
- },
- {
- "find":"kT",
- "replace":"ক্ট",
- "rules":
- [
- ]
- },
- {
- "find":"kt",
- "replace":"ক্ত",
- "rules":
- [
- ]
- },
- {
- "find":"kl",
- "replace":"ক্ল",
- "rules":
- [
- ]
- },
- {
- "find":"ks",
- "replace":"ক্স",
- "rules":
- [
- ]
- },
- {
- "find":"kh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"k",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"lbh",
- "replace":"ল্ভ",
- "rules":
- [
- ]
- },
- {
- "find":"ldh",
- "replace":"ল্ধ",
- "rules":
- [
- ]
- },
- {
- "find":"lkh",
- "replace":"লখ",
- "rules":
- [
- ]
- },
- {
- "find":"lgh",
- "replace":"লঘ",
- "rules":
- [
- ]
- },
- {
- "find":"lph",
- "replace":"লফ",
- "rules":
- [
- ]
- },
- {
- "find":"lk",
- "replace":"ল্ক",
- "rules":
- [
- ]
- },
- {
- "find":"lg",
- "replace":"ল্গ",
- "rules":
- [
- ]
- },
- {
- "find":"lT",
- "replace":"ল্ট",
- "rules":
- [
- ]
- },
- {
- "find":"lD",
- "replace":"ল্ড",
- "rules":
- [
- ]
- },
- {
- "find":"lp",
- "replace":"ল্প",
- "rules":
- [
- ]
- },
- {
- "find":"lv",
- "replace":"ল্ভ",
- "rules":
- [
- ]
- },
- {
- "find":"lm",
- "replace":"ল্ম",
- "rules":
- [
- ]
- },
- {
- "find":"ll",
- "replace":"ল্ল",
- "rules":
- [
- ]
- },
- {
- "find":"lb",
- "replace":"ল্ব",
- "rules":
- [
- ]
- },
- {
- "find":"l",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"mth",
- "replace":"ম্থ",
- "rules":
- [
- ]
- },
- {
- "find":"mph",
- "replace":"ম্ফ",
- "rules":
- [
- ]
- },
- {
- "find":"mbh",
- "replace":"ম্ভ",
- "rules":
- [
- ]
- },
- {
- "find":"mpl",
- "replace":"মপ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"mn",
- "replace":"ম্ন",
- "rules":
- [
- ]
- },
- {
- "find":"mp",
- "replace":"ম্প",
- "rules":
- [
- ]
- },
- {
- "find":"mv",
- "replace":"ম্ভ",
- "rules":
- [
- ]
- },
- {
- "find":"mm",
- "replace":"ম্ম",
- "rules":
- [
- ]
- },
- {
- "find":"ml",
- "replace":"ম্ল",
- "rules":
- [
- ]
- },
- {
- "find":"mb",
- "replace":"ম্ব",
- "rules":
- [
- ]
- },
- {
- "find":"mf",
- "replace":"ম্ফ",
- "rules":
- [
- ]
- },
- {
- "find":"m",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"0",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"1",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"2",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"3",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"4",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"5",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"6",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"7",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"8",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"9",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"NgkSh",
- "replace":"ঙ্ক্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngkkh",
- "replace":"ঙ্ক্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"NGch",
- "replace":"ঞ্ছ",
- "rules":
- [
- ]
- },
- {
- "find":"Nggh",
- "replace":"ঙ্ঘ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngkh",
- "replace":"ঙ্খ",
- "rules":
- [
- ]
- },
- {
- "find":"NGjh",
- "replace":"ঞ্ঝ",
- "rules":
- [
- ]
- },
- {
- "find":"ngOU",
- "replace":"ঙ্গৌ",
- "rules":
- [
- ]
- },
- {
- "find":"ngOI",
- "replace":"ঙ্গৈ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngkx",
- "replace":"ঙ্ক্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"NGc",
- "replace":"ঞ্চ",
- "rules":
- [
- ]
- },
- {
- "find":"nch",
- "replace":"ঞ্ছ",
- "rules":
- [
- ]
- },
- {
- "find":"njh",
- "replace":"ঞ্ঝ",
- "rules":
- [
- ]
- },
- {
- "find":"ngh",
- "replace":"ঙ্ঘ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngk",
- "replace":"ঙ্ক",
- "rules":
- [
- ]
- },
- {
- "find":"Ngx",
- "replace":"ঙ্ষ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngg",
- "replace":"ঙ্গ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngm",
- "replace":"ঙ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"NGj",
- "replace":"ঞ্জ",
- "rules":
- [
- ]
- },
- {
- "find":"ndh",
- "replace":"ন্ধ",
- "rules":
- [
- ]
- },
- {
- "find":"nTh",
- "replace":"ন্ঠ",
- "rules":
- [
- ]
- },
- {
- "find":"NTh",
- "replace":"ণ্ঠ",
- "rules":
- [
- ]
- },
- {
- "find":"nth",
- "replace":"ন্থ",
- "rules":
- [
- ]
- },
- {
- "find":"nkh",
- "replace":"ঙ্খ",
- "rules":
- [
- ]
- },
- {
- "find":"ngo",
- "replace":"ঙ্গ",
- "rules":
- [
- ]
- },
- {
- "find":"nga",
- "replace":"ঙ্গা",
- "rules":
- [
- ]
- },
- {
- "find":"ngi",
- "replace":"ঙ্গি",
- "rules":
- [
- ]
- },
- {
- "find":"ngI",
- "replace":"ঙ্গী",
- "rules":
- [
- ]
- },
- {
- "find":"ngu",
- "replace":"ঙ্গু",
- "rules":
- [
- ]
- },
- {
- "find":"ngU",
- "replace":"ঙ্গূ",
- "rules":
- [
- ]
- },
- {
- "find":"nge",
- "replace":"ঙ্গে",
- "rules":
- [
- ]
- },
- {
- "find":"ngO",
- "replace":"ঙ্গো",
- "rules":
- [
- ]
- },
- {
- "find":"NDh",
- "replace":"ণ্ঢ",
- "rules":
- [
- ]
- },
- {
- "find":"nsh",
- "replace":"নশ",
- "rules":
- [
- ]
- },
- {
- "find":"Ngr",
- "replace":"ঙর",
- "rules":
- [
- ]
- },
- {
- "find":"NGr",
- "replace":"ঞর",
- "rules":
- [
- ]
- },
- {
- "find":"ngr",
- "replace":"ংর",
- "rules":
- [
- ]
- },
- {
- "find":"nj",
- "replace":"ঞ্জ",
- "rules":
- [
- ]
- },
- {
- "find":"Ng",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"NG",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"nk",
- "replace":"ঙ্ক",
- "rules":
- [
- ]
- },
- {
- "find":"ng",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"nn",
- "replace":"ন্ন",
- "rules":
- [
- ]
- },
- {
- "find":"NN",
- "replace":"ণ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"Nn",
- "replace":"ণ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"nm",
- "replace":"ন্ম",
- "rules":
- [
- ]
- },
- {
- "find":"Nm",
- "replace":"ণ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"nd",
- "replace":"ন্দ",
- "rules":
- [
- ]
- },
- {
- "find":"nT",
- "replace":"ন্ট",
- "rules":
- [
- ]
- },
- {
- "find":"NT",
- "replace":"ণ্ট",
- "rules":
- [
- ]
- },
- {
- "find":"nD",
- "replace":"ন্ড",
- "rules":
- [
- ]
- },
- {
- "find":"ND",
- "replace":"ণ্ড",
- "rules":
- [
- ]
- },
- {
- "find":"nt",
- "replace":"ন্ত",
- "rules":
- [
- ]
- },
- {
- "find":"ns",
- "replace":"ন্স",
- "rules":
- [
- ]
- },
- {
- "find":"nc",
- "replace":"ঞ্চ",
- "rules":
- [
- ]
- },
- {
- "find":"n",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"N",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"OI`",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"OU`",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"O`",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"OI",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"TRUE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"punctuation",
- "value":"",
- "negative":"FALSE"
- }
- ],
- "replace":""
- }
- ]
- },
- {
- "find":"OU",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"TRUE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"punctuation",
- "value":"",
- "negative":"FALSE"
- }
- ],
- "replace":""
- }
- ]
- },
- {
- "find":"O",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"TRUE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"punctuation",
- "value":"",
- "negative":"FALSE"
- }
- ],
- "replace":""
- }
- ]
- },
- {
- "find":"phl",
- "replace":"ফ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"pT",
- "replace":"প্ট",
- "rules":
- [
- ]
- },
- {
- "find":"pt",
- "replace":"প্ত",
- "rules":
- [
- ]
- },
- {
- "find":"pn",
- "replace":"প্ন",
- "rules":
- [
- ]
- },
- {
- "find":"pp",
- "replace":"প্প",
- "rules":
- [
- ]
- },
- {
- "find":"pl",
- "replace":"প্ল",
- "rules":
- [
- ]
- },
- {
- "find":"ps",
- "replace":"প্স",
- "rules":
- [
- ]
- },
- {
- "find":"ph",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"fl",
- "replace":"ফ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"f",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"p",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"rri`",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"rri",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"TRUE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"punctuation",
- "value":"",
- "negative":"FALSE"
- }
- ],
- "replace":""
- }
- ]
- },
- {
- "find":"rrZ",
- "replace":"রর‍্য",
- "rules":
- [
- ]
- },
- {
- "find":"rry",
- "replace":"রর‍্য",
- "rules":
- [
- ]
- },
- {
- "find":"rZ",
- "replace":"র‍্য",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"r",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"y",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"w",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"x",
- "negative":"TRUE"
- }
- ],
- "replace":"্র্য"
- }
- ]
- },
- {
- "find":"ry",
- "replace":"র‍্য",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"r",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"y",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"w",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"x",
- "negative":"TRUE"
- }
- ],
- "replace":"্র্য"
- }
- ]
- },
- {
- "find":"rr",
- "replace":"রর",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"TRUE"
- },
- {
- "type":"suffix",
- "scope":"vowel",
- "value":"",
- "negative":"TRUE"
- },
- {
- "type":"suffix",
- "scope":"exact",
- "value":"r",
- "negative":"TRUE"
- },
- {
- "type":"suffix",
- "scope":"punctuation",
- "value":"",
- "negative":"TRUE"
- }
- ],
- "replace":"র্"
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"r",
- "negative":"TRUE"
- }
- ],
- "replace":"্রর"
- }
- ]
- },
- {
- "find":"Rg",
- "replace":"ড়্গ",
- "rules":
- [
- ]
- },
- {
- "find":"Rh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"R",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"r",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"r",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"y",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"w",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"x",
- "negative":"TRUE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"Z",
- "negative":"TRUE"
- }
- ],
- "replace":"্র"
- }
- ]
- },
- {
- "find":"shch",
- "replace":"শ্ছ",
- "rules":
- [
- ]
- },
- {
- "find":"ShTh",
- "replace":"ষ্ঠ",
- "rules":
- [
- ]
- },
- {
- "find":"Shph",
- "replace":"ষ্ফ",
- "rules":
- [
- ]
- },
- {
- "find":"Sch",
- "replace":"শ্ছ",
- "rules":
- [
- ]
- },
- {
- "find":"skl",
- "replace":"স্ক্ল",
- "rules":
- [
- ]
- },
- {
- "find":"skh",
- "replace":"স্খ",
- "rules":
- [
- ]
- },
- {
- "find":"sth",
- "replace":"স্থ",
- "rules":
- [
- ]
- },
- {
- "find":"sph",
- "replace":"স্ফ",
- "rules":
- [
- ]
- },
- {
- "find":"shc",
- "replace":"শ্চ",
- "rules":
- [
- ]
- },
- {
- "find":"sht",
- "replace":"শ্ত",
- "rules":
- [
- ]
- },
- {
- "find":"shn",
- "replace":"শ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"shm",
- "replace":"শ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"shl",
- "replace":"শ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"Shk",
- "replace":"ষ্ক",
- "rules":
- [
- ]
- },
- {
- "find":"ShT",
- "replace":"ষ্ট",
- "rules":
- [
- ]
- },
- {
- "find":"ShN",
- "replace":"ষ্ণ",
- "rules":
- [
- ]
- },
- {
- "find":"Shp",
- "replace":"ষ্প",
- "rules":
- [
- ]
- },
- {
- "find":"Shf",
- "replace":"ষ্ফ",
- "rules":
- [
- ]
- },
- {
- "find":"Shm",
- "replace":"ষ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"spl",
- "replace":"স্প্ল",
- "rules":
- [
- ]
- },
- {
- "find":"sk",
- "replace":"স্ক",
- "rules":
- [
- ]
- },
- {
- "find":"Sc",
- "replace":"শ্চ",
- "rules":
- [
- ]
- },
- {
- "find":"sT",
- "replace":"স্ট",
- "rules":
- [
- ]
- },
- {
- "find":"st",
- "replace":"স্ত",
- "rules":
- [
- ]
- },
- {
- "find":"sn",
- "replace":"স্ন",
- "rules":
- [
- ]
- },
- {
- "find":"sp",
- "replace":"স্প",
- "rules":
- [
- ]
- },
- {
- "find":"sf",
- "replace":"স্ফ",
- "rules":
- [
- ]
- },
- {
- "find":"sm",
- "replace":"স্ম",
- "rules":
- [
- ]
- },
- {
- "find":"sl",
- "replace":"স্ল",
- "rules":
- [
- ]
- },
- {
- "find":"sh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"Sc",
- "replace":"শ্চ",
- "rules":
- [
- ]
- },
- {
- "find":"St",
- "replace":"শ্ত",
- "rules":
- [
- ]
- },
- {
- "find":"Sn",
- "replace":"শ্ন",
- "rules":
- [
- ]
- },
- {
- "find":"Sm",
- "replace":"শ্ম",
- "rules":
- [
- ]
- },
- {
- "find":"Sl",
- "replace":"শ্ল",
- "rules":
- [
- ]
- },
- {
- "find":"Sh",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"s",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"S",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"oo`",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"oo",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"consonant",
- "value":"",
- "negative":"TRUE"
- },
- {
- "type":"suffix",
- "scope":"exact",
- "value":"`",
- "negative":"TRUE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"punctuation",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"suffix",
- "scope":"exact",
- "value":"`",
- "negative":"TRUE"
- }
- ],
- "replace":""
- }
- ]
- },
- {
- "find":"o`",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"oZ",
- "replace":"অ্য",
- "rules":
- [
- ]
- },
- {
- "find":"o",
- "replace":"",
- "rules":
- [
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"vowel",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"o",
- "negative":"TRUE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"vowel",
- "value":"",
- "negative":"FALSE"
- },
- {
- "type":"prefix",
- "scope":"exact",
- "value":"o",
- "negative":"FALSE"
- }
- ],
- "replace":""
- },
- {
- "matches":
- [
- {
- "type":"prefix",
- "scope":"punctuation",
- "value":"",
- "negative":"FALSE"
- }
- ],
- "replace":""
- }
- ]
- },
- {
- "find":"tth",
- "replace":"ত্থ",
- "rules":
- [
- ]
- },
- {
- "find":"t``",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"TT",
- "replace":"ট্ট",
- "rules":
- [
- ]
- },
- {
- "find":"Tm",
- "replace":"ট্ম",
- "rules":
- [
- ]
- },
- {
- "find":"Th",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"tn",
- "replace":"ত্ন",
- "rules":
- [
- ]
- },
- {
- "find":"tm",
- "replace":"ত্ম",
- "rules":
- [
- ]
- },
- {
- "find":"th",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"tt",
- "replace":"ত্ত",
- "rules":
- [
- ]
- },
- {
- "find":"T",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"t",
- "replace":"",
- "rules":
- [
- ]
- },
- {
- "find":"aZ",
- "replace":"অ্যা",
- "rules":
- [
- ]
- },
- {
- "find":"AZ",
- "replace":"অ্যা",
- "rules":
- [
- ]
- },
- {