@@ -36,46 +36,46 @@ protected RefinedSoundex createStringEncoder() {
36
36
@ Test
37
37
public void testDifference () throws EncoderException {
38
38
// Edge cases
39
- assertEquals (0 , this . getStringEncoder ().difference (null , null ));
40
- assertEquals (0 , this . getStringEncoder ().difference ("" , "" ));
41
- assertEquals (0 , this . getStringEncoder ().difference (" " , " " ));
39
+ assertEquals (0 , getStringEncoder ().difference (null , null ));
40
+ assertEquals (0 , getStringEncoder ().difference ("" , "" ));
41
+ assertEquals (0 , getStringEncoder ().difference (" " , " " ));
42
42
// Normal cases
43
- assertEquals (6 , this . getStringEncoder ().difference ("Smith" , "Smythe" ));
44
- assertEquals (3 , this . getStringEncoder ().difference ("Ann" , "Andrew" ));
45
- assertEquals (1 , this . getStringEncoder ().difference ("Margaret" , "Andrew" ));
46
- assertEquals (1 , this . getStringEncoder ().difference ("Janet" , "Margaret" ));
43
+ assertEquals (6 , getStringEncoder ().difference ("Smith" , "Smythe" ));
44
+ assertEquals (3 , getStringEncoder ().difference ("Ann" , "Andrew" ));
45
+ assertEquals (1 , getStringEncoder ().difference ("Margaret" , "Andrew" ));
46
+ assertEquals (1 , getStringEncoder ().difference ("Janet" , "Margaret" ));
47
47
// Examples from
48
48
// https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_de-dz_8co5.asp
49
- assertEquals (5 , this . getStringEncoder ().difference ("Green" , "Greene" ));
50
- assertEquals (1 , this . getStringEncoder ().difference ("Blotchet-Halls" , "Greene" ));
49
+ assertEquals (5 , getStringEncoder ().difference ("Green" , "Greene" ));
50
+ assertEquals (1 , getStringEncoder ().difference ("Blotchet-Halls" , "Greene" ));
51
51
// Examples from
52
52
// https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_setu-sus_3o6w.asp
53
- assertEquals (6 , this . getStringEncoder ().difference ("Smith" , "Smythe" ));
54
- assertEquals (8 , this . getStringEncoder ().difference ("Smithers" , "Smythers" ));
55
- assertEquals (5 , this . getStringEncoder ().difference ("Anothers" , "Brothers" ));
53
+ assertEquals (6 , getStringEncoder ().difference ("Smith" , "Smythe" ));
54
+ assertEquals (8 , getStringEncoder ().difference ("Smithers" , "Smythers" ));
55
+ assertEquals (5 , getStringEncoder ().difference ("Anothers" , "Brothers" ));
56
56
}
57
57
58
58
@ Test
59
59
public void testEncode () {
60
- assertEquals ("T6036084" , this . getStringEncoder ().encode ("testing" ));
61
- assertEquals ("T6036084" , this . getStringEncoder ().encode ("TESTING" ));
62
- assertEquals ("T60" , this . getStringEncoder ().encode ("The" ));
63
- assertEquals ("Q503" , this . getStringEncoder ().encode ("quick" ));
64
- assertEquals ("B1908" , this . getStringEncoder ().encode ("brown" ));
65
- assertEquals ("F205" , this . getStringEncoder ().encode ("fox" ));
66
- assertEquals ("J408106" , this . getStringEncoder ().encode ("jumped" ));
67
- assertEquals ("O0209" , this . getStringEncoder ().encode ("over" ));
68
- assertEquals ("T60" , this . getStringEncoder ().encode ("the" ));
69
- assertEquals ("L7050" , this . getStringEncoder ().encode ("lazy" ));
70
- assertEquals ("D6043" , this . getStringEncoder ().encode ("dogs" ));
60
+ assertEquals ("T6036084" , getStringEncoder ().encode ("testing" ));
61
+ assertEquals ("T6036084" , getStringEncoder ().encode ("TESTING" ));
62
+ assertEquals ("T60" , getStringEncoder ().encode ("The" ));
63
+ assertEquals ("Q503" , getStringEncoder ().encode ("quick" ));
64
+ assertEquals ("B1908" , getStringEncoder ().encode ("brown" ));
65
+ assertEquals ("F205" , getStringEncoder ().encode ("fox" ));
66
+ assertEquals ("J408106" , getStringEncoder ().encode ("jumped" ));
67
+ assertEquals ("O0209" , getStringEncoder ().encode ("over" ));
68
+ assertEquals ("T60" , getStringEncoder ().encode ("the" ));
69
+ assertEquals ("L7050" , getStringEncoder ().encode ("lazy" ));
70
+ assertEquals ("D6043" , getStringEncoder ().encode ("dogs" ));
71
71
72
72
// Testing CODEC-56
73
73
assertEquals ("D6043" , RefinedSoundex .US_ENGLISH .encode ("dogs" ));
74
74
}
75
75
76
76
@ Test
77
77
public void testGetMappingCodeNonLetter () {
78
- final char code = this . getStringEncoder ().getMappingCode ('#' );
78
+ final char code = getStringEncoder ().getMappingCode ('#' );
79
79
assertEquals (0 , code , "Code does not equals zero" );
80
80
}
81
81
0 commit comments