Skip to content

Commit

Permalink
Punctuation removed
Browse files Browse the repository at this point in the history
  • Loading branch information
torifat committed Oct 31, 2011
1 parent 7188b1b commit a5f2472
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/com/omicronlab/avro/PhoneticParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class PhoneticParser {
private static List<Pattern> patterns;
private static String vowel = "";
private static String consonant = "";
private static String punctuation = "";
private static String casesensitive = "";
private boolean initialized = false;

Expand Down Expand Up @@ -71,7 +70,6 @@ public synchronized void init() throws Exception {
patterns = data.getPatterns();
vowel = data.getVowel();
consonant = data.getConsonant();
punctuation = data.getPunctuation();
casesensitive = data.getCasesensitive();
initialized = true;
}
Expand Down Expand Up @@ -218,7 +216,7 @@ private boolean isConsonant(char c) {
}

private boolean isPunctuation(char c) {
return ((punctuation.indexOf(Character.toLowerCase(c)) >= 0));
return (!(this.isVowel(c) || this.isConsonant(c)));
}

private boolean isExact(String needle, String heystack, int start, int end, boolean not) {
Expand Down
9 changes: 0 additions & 9 deletions src/com/omicronlab/avro/phonetic/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class Data {
private List<Pattern> patterns;
private String vowel = "";
private String consonant = "";
private String punctuation = "";
private String casesensitive = "";

public Data() {
Expand Down Expand Up @@ -65,14 +64,6 @@ public void setConsonant(String consonant) {
this.consonant = consonant;
}

public String getPunctuation() {
return punctuation;
}

public void setPunctuation(String punctuation) {
this.punctuation = punctuation;
}

public String getCasesensitive() {
return casesensitive;
}
Expand Down
5 changes: 2 additions & 3 deletions src/com/omicronlab/avro/phonetic/phonetic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<classes>
<vowel>aeiou</vowel>
<consonant>bcdfghjklmnpqrstvwxyz</consonant>
<punctuation>. ?</punctuation>
<casesensitive>oiudgjnrstyz</casesensitive>
</classes>
<patterns>
Expand All @@ -16,12 +15,12 @@
<find>bj</find>
<replace>ব্জ</replace>
<rules/>
</pattern>
</pattern>
<pattern>
<find>bd</find>
<replace>ব্দ</replace>
<rules/>
</pattern>
</pattern>
<pattern>
<find>bb</find>
<replace>ব্ব</replace>
Expand Down

0 comments on commit a5f2472

Please sign in to comment.