|
31 | 31 | * </ul> |
32 | 32 | * |
33 | 33 | * @author Apache Software Foundation |
34 | | - * @version $Id: DoubleMetaphone.java,v 1.21 2004/05/24 00:25:22 ggregory Exp $ |
| 34 | + * @version $Id: DoubleMetaphone.java,v 1.22 2004/05/24 00:28:10 ggregory Exp $ |
35 | 35 | */ |
36 | 36 | public class DoubleMetaphone implements StringEncoder { |
37 | 37 |
|
@@ -806,28 +806,24 @@ private int handleZ(String value, DoubleMetaphoneResult result, int index, |
806 | 806 | * Complex condition 0 for 'C' |
807 | 807 | */ |
808 | 808 | private boolean conditionC0(String value, int index) { |
809 | | - if (contains(value, index, 4, "CHIA")) { |
810 | | - return true; |
811 | | - } else if (index <= 1) { |
812 | | - return false; |
813 | | - } else if (isVowel(charAt(value, index - 2))) { |
814 | | - return false; |
815 | | - } else if (!contains(value, index - 1, 3, "ACH")) { |
816 | | - return false; |
817 | | - } else { |
818 | | - char c = charAt(value, index + 2); |
819 | | - if ((c != 'I' && c != 'E') || contains(value, index - 2, |
820 | | - 6, "BACHER", "MACHER" )) { |
821 | | - return true; |
822 | | - } else { |
823 | | - return false; |
824 | | - } |
825 | | - } |
826 | | - } |
| 809 | + if (contains(value, index, 4, "CHIA")) { |
| 810 | + return true; |
| 811 | + } else if (index <= 1) { |
| 812 | + return false; |
| 813 | + } else if (isVowel(charAt(value, index - 2))) { |
| 814 | + return false; |
| 815 | + } else if (!contains(value, index - 1, 3, "ACH")) { |
| 816 | + return false; |
| 817 | + } else { |
| 818 | + char c = charAt(value, index + 2); |
| 819 | + return (c != 'I' && c != 'E') |
| 820 | + || contains(value, index - 2, 6, "BACHER", "MACHER"); |
| 821 | + } |
| 822 | + } |
827 | 823 |
|
828 | 824 | /** |
829 | | - * Complex condition 0 for 'CH' |
830 | | - */ |
| 825 | + * Complex condition 0 for 'CH' |
| 826 | + */ |
831 | 827 | private boolean conditionCH0(String value, int index) { |
832 | 828 | if (index != 0) { |
833 | 829 | return false; |
|
0 commit comments