Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–448 unchanged (448 lines)
449 } else if (contains(value, index + 1, 1, "E", "I", "Y") ||
450 contains(value, index - 1, 4, "AGGI", "OGGI")) {
451 //-- Italian "biaggi" --//
452 if ((contains(value, 0 ,4, "VAN ", "VON ") || contains(value, 0, 3, "SCH")) || contains(value, index + 1, 2, "ET")) {
453 //-- obvious germanic --//
454 result.append('K');
455 } else if (contains(value, index + 1, 4, "IER")) {
456 result.append('J');
457 } else {
458 result.append('J', 'K');
459 }
460 index += 2;
461 } else if (charAt(value, index + 1) == 'G') {
…lines 462–1106 unchanged (645 lines)

After

…lines 1–448 unchanged (448 lines)
449 } else if (contains(value, index + 1, 1, "E", "I", "Y") ||
450 contains(value, index - 1, 4, "AGGI", "OGGI")) {
451 //-- Italian "biaggi" --//
452 if ((contains(value, 0 ,4, "VAN ", "VON ") || contains(value, 0, 3, "SCH")) || contains(value, index + 1, 2, "ET")) {
453 //-- obvious germanic --//
454 result.append('K');
455 } else if (contains(value, index + 1, 3, "IER")) {
456 result.append('J');
457 } else {
458 result.append('J', 'K');
459 }
460 index += 2;
461 } else if (charAt(value, index + 1) == 'G') {
…lines 462–1106 unchanged (645 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "language"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "EncoderException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "StringEncoder"
; ";"
block_comment "/**\n * Encodes a string into a double metaphone value.\n * Th"...
class_declaration
modifiers
public "public"
class "class"
identifier "DoubleMetaphone"
super_interfaces
implements "implements"
type_list
type_identifier "StringEncoder"
class_body
{ "{"
block_comment "/**\n * \"Vowels\" to test for\n */"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "VOWELS"
= "="
string_literal
" "\""
string_fragment "AEIOUY"
" "\""
; ";"
block_comment "/**\n * Prefixes when present which are not pronounced\n "...
field_declaration (+41 nodes collapsed)
field_declaration (+66 nodes collapsed)
field_declaration (+71 nodes collapsed)
field_declaration (+56 nodes collapsed)
block_comment "/**\n * Maximum length of an encoding, default is 4\n "...
field_declaration
modifiers
protected "protected"
integral_type
int "int"
variable_declarator
identifier "maxCodeLen"
= "="
decimal_integer_literal "4"
; ";"
block_comment "/**\n * Creates an instance of this DoubleMetaphone encod"...
constructor_declaration
modifiers
public "public"
identifier "DoubleMetaphone"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Encode a value with Double Metaphone\n *\n "...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Encode a value with Double Metaphone, optionally "...
method_declaration (+910 nodes collapsed)
block_comment "/**\n * Encode the value using DoubleMetaphone. It will "...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * Encode the value using DoubleMetaphone.\n *\n "...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Check if the Double Metaphone values of two <code"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Check if the Double Metaphone values of two <code"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Returns the maxCodeLen.\n * @return int\n *"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMaxCodeLen"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "maxCodeLen"
; ";"
} "}"
block_comment "/**\n * Sets the maxCodeLen.\n * @param maxCodeLen The"...
method_declaration (+24 nodes collapsed)
line_comment "//-- BEGIN HANDLERS --//"
block_comment "/**\n * Handles 'A', 'E', 'I', 'O', 'U', and 'Y' cases\n "...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Handles 'C' cases\n */"
method_declaration (+603 nodes collapsed)
block_comment "/**\n * Handles 'CC' cases\n */"
method_declaration (+199 nodes collapsed)
block_comment "/**\n * Handles 'CH' cases\n */"
method_declaration (+229 nodes collapsed)
block_comment "/**\n * Handles 'D' cases\n */"
method_declaration (+192 nodes collapsed)
block_comment "/**\n * Handles 'G' cases\n */"
method_declaration
modifiers
private "private"
integral_type
int "int"
identifier "handleG"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "value"
, ","
formal_parameter
type_identifier "DoubleMetaphoneResult"
identifier "result"
, ","
formal_parameter
integral_type
int "int"
identifier "index"
, ","
formal_parameter
boolean_type "boolean"
identifier "slavoGermanic"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "charAt"
argument_list
( "("
identifier "value"
, ","
binary_expression
identifier "index"
+ "+"
decimal_integer_literal "1"
) ")"
== "=="
character_literal "'H'"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "index"
= "="
method_invocation
identifier "handleGH"
argument_list
( "("
identifier "value"
, ","
identifier "result"
, ","
identifier "index"
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "charAt"
argument_list
( "("
identifier "value"
, ","
binary_expression
identifier "index"
+ "+"
decimal_integer_literal "1"
) ")"
== "=="
character_literal "'N'"
) ")"
block (+147 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+26 nodes collapsed)
block (+27 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+43 nodes collapsed)
block (+22 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+123 nodes collapsed)
block (+22 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+56 nodes collapsed)
block
{ "{"
line_comment "//-- Italian \"biaggi\" --//"
if_statement
if "if"
parenthesized_expression (+63 nodes collapsed)
block
{ "{"
line_comment "//-- obvious germanic --//"
expression_statement
method_invocation
identifier "result"
. "."
identifier "append"
argument_list
( "("
character_literal "'K'"
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "contains"
argument_list
( "("
identifier "value"
, ","
binary_expression
identifier "index"
+ "+"
decimal_integer_literal "1"
, ","
decimal_integer_literal "4"
, ","
string_literal
" "\""
string_fragment "IER"
" "\""
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "result"
. "."
identifier "append"
argument_list
( "("
character_literal "'J'"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "result"
. "."
identifier "append"
argument_list
( "("
character_literal "'J'"
, ","
character_literal "'K'"
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "index"
+= "+="
decimal_integer_literal "2"
; ";"
} "}"
else "else"
if_statement (+57 nodes collapsed)
return_statement
return "return"
identifier "index"
; ";"
} "}"
block_comment "/**\n * Handles 'GH' cases\n */"
method_declaration (+395 nodes collapsed)
block_comment "/**\n * Handles 'H' cases\n */"
method_declaration (+106 nodes collapsed)
block_comment "/**\n * Handles 'J' cases\n */"
method_declaration (+430 nodes collapsed)
block_comment "/**\n * Handles 'L' cases\n */"
method_declaration (+115 nodes collapsed)
block_comment "/**\n * Handles 'P' cases\n */"
method_declaration (+119 nodes collapsed)
block_comment "/**\n * Handles 'R' cases\n */"
method_declaration (+153 nodes collapsed)
block_comment "/**\n * Handles 'S' cases\n */"
method_declaration (+575 nodes collapsed)
block_comment "/**\n * Handles 'SC' cases\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Handles 'T' cases\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Handles 'W' cases\n */"
method_declaration (+353 nodes collapsed)
block_comment "/**\n * Handles 'X' cases\n */"
method_declaration (+194 nodes collapsed)
block_comment "/**\n * Handles 'Z' cases\n */"
method_declaration (+204 nodes collapsed)
line_comment "//-- BEGIN CONDITIONS --//"
block_comment "/**\n * Complex condition 0 for 'C'\n */"
method_declaration (+188 nodes collapsed)
block_comment "/**\n * Complex condition 0 for 'CH'\n */"
method_declaration (+146 nodes collapsed)
block_comment "/**\n * Complex condition 1 for 'CH'\n */"
method_declaration (+205 nodes collapsed)
block_comment "/**\n * Complex condition 0 for 'L'\n */"
method_declaration (+178 nodes collapsed)
block_comment "/**\n * Complex condition 0 for 'M'\n */"
method_declaration (+110 nodes collapsed)
line_comment "//-- BEGIN HELPER FUNCTIONS --//"
block_comment "/**\n * Determines whether or not a value is of slavo-ger"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Determines whether or not a character is a vowel "...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Determines whether or not the value starts with a"...
method_declaration (+80 nodes collapsed)
block_comment "/**\n * Cleans the input\n */"
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Gets the character at index <code>index</code> if"...
method_declaration (+62 nodes collapsed)
block_comment "/**\n * Shortcut method with 1 criteria\n */"
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Shortcut method with 2 criteria\n */"
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Shortcut method with 3 criteria\n */"
method_declaration (+65 nodes collapsed)
block_comment "/**\n * Shortcut method with 4 criteria\n */"
method_declaration (+71 nodes collapsed)
block_comment "/**\n * Shortcut method with 5 criteria\n */"
method_declaration (+77 nodes collapsed)
block_comment "/**\n * Shortcut method with 6 criteria\n */"
method_declaration (+83 nodes collapsed)
block_comment "/**\n * Determines whether <code>value</code> contains an"...
method_declaration (+145 nodes collapsed)
line_comment "//-- BEGIN INNER CLASSES --//"
block_comment "/**\n * Inner class for storing results, since there is t"...
class_declaration (+596 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "language"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "EncoderException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "codec"
. "."
identifier "StringEncoder"
; ";"
block_comment "/**\n * Encodes a string into a double metaphone value.\n * Th"...
class_declaration
modifiers
public "public"
class "class"
identifier "DoubleMetaphone"
super_interfaces
implements "implements"
type_list
type_identifier "StringEncoder"
class_body
{ "{"
block_comment "/**\n * \"Vowels\" to test for\n */"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "VOWELS"
= "="
string_literal
" "\""
string_fragment "AEIOUY"
" "\""
; ";"
block_comment "/**\n * Prefixes when present which are not pronounced\n "...
field_declaration (+41 nodes collapsed)
field_declaration (+66 nodes collapsed)
field_declaration (+71 nodes collapsed)
field_declaration (+56 nodes collapsed)
block_comment "/**\n * Maximum length of an encoding, default is 4\n "...
field_declaration
modifiers
protected "protected"
integral_type
int "int"
variable_declarator
identifier "maxCodeLen"
= "="
decimal_integer_literal "4"
; ";"
block_comment "/**\n * Creates an instance of this DoubleMetaphone encod"...
constructor_declaration
modifiers
public "public"
identifier "DoubleMetaphone"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Encode a value with Double Metaphone\n *\n "...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Encode a value with Double Metaphone, optionally "...
method_declaration (+910 nodes collapsed)
block_comment "/**\n * Encode the value using DoubleMetaphone. It will "...
method_declaration (+60 nodes collapsed)
block_comment "/**\n * Encode the value using DoubleMetaphone.\n *\n "...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Check if the Double Metaphone values of two <code"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Check if the Double Metaphone values of two <code"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Returns the maxCodeLen.\n * @return int\n *"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getMaxCodeLen"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "maxCodeLen"
; ";"
} "}"
block_comment "/**\n * Sets the maxCodeLen.\n * @param maxCodeLen The"...
method_declaration (+24 nodes collapsed)
line_comment "//-- BEGIN HANDLERS --//"
block_comment "/**\n * Handles 'A', 'E', 'I', 'O', 'U', and 'Y' cases\n "...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Handles 'C' cases\n */"
method_declaration (+603 nodes collapsed)
block_comment "/**\n * Handles 'CC' cases\n */"
method_declaration (+199 nodes collapsed)
block_comment "/**\n * Handles 'CH' cases\n */"
method_declaration (+229 nodes collapsed)
block_comment "/**\n * Handles 'D' cases\n */"
method_declaration (+192 nodes collapsed)
block_comment "/**\n * Handles 'G' cases\n */"
method_declaration
modifiers
private "private"
integral_type
int "int"
identifier "handleG"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "value"
, ","
formal_parameter
type_identifier "DoubleMetaphoneResult"
identifier "result"
, ","
formal_parameter
integral_type
int "int"
identifier "index"
, ","
formal_parameter
boolean_type "boolean"
identifier "slavoGermanic"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "charAt"
argument_list
( "("
identifier "value"
, ","
binary_expression
identifier "index"
+ "+"
decimal_integer_literal "1"
) ")"
== "=="
character_literal "'H'"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "index"
= "="
method_invocation
identifier "handleGH"
argument_list
( "("
identifier "value"
, ","
identifier "result"
, ","
identifier "index"
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "charAt"
argument_list
( "("
identifier "value"
, ","
binary_expression
identifier "index"
+ "+"
decimal_integer_literal "1"
) ")"
== "=="
character_literal "'N'"
) ")"
block (+147 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+26 nodes collapsed)
block (+27 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+43 nodes collapsed)
block (+22 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+123 nodes collapsed)
block (+22 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression (+56 nodes collapsed)
block
{ "{"
line_comment "//-- Italian \"biaggi\" --//"
if_statement
if "if"
parenthesized_expression (+63 nodes collapsed)
block
{ "{"
line_comment "//-- obvious germanic --//"
expression_statement
method_invocation
identifier "result"
. "."
identifier "append"
argument_list
( "("
character_literal "'K'"
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "contains"
argument_list
( "("
identifier "value"
, ","
binary_expression
identifier "index"
+ "+"
decimal_integer_literal "1"
, ","
decimal_integer_literal "3"
, ","
string_literal
" "\""
string_fragment "IER"
" "\""
) ")"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "result"
. "."
identifier "append"
argument_list
( "("
character_literal "'J'"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "result"
. "."
identifier "append"
argument_list
( "("
character_literal "'J'"
, ","
character_literal "'K'"
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "index"
+= "+="
decimal_integer_literal "2"
; ";"
} "}"
else "else"
if_statement (+57 nodes collapsed)
return_statement
return "return"
identifier "index"
; ";"
} "}"
block_comment "/**\n * Handles 'GH' cases\n */"
method_declaration (+395 nodes collapsed)
block_comment "/**\n * Handles 'H' cases\n */"
method_declaration (+106 nodes collapsed)
block_comment "/**\n * Handles 'J' cases\n */"
method_declaration (+430 nodes collapsed)
block_comment "/**\n * Handles 'L' cases\n */"
method_declaration (+115 nodes collapsed)
block_comment "/**\n * Handles 'P' cases\n */"
method_declaration (+119 nodes collapsed)
block_comment "/**\n * Handles 'R' cases\n */"
method_declaration (+153 nodes collapsed)
block_comment "/**\n * Handles 'S' cases\n */"
method_declaration (+575 nodes collapsed)
block_comment "/**\n * Handles 'SC' cases\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Handles 'T' cases\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Handles 'W' cases\n */"
method_declaration (+353 nodes collapsed)
block_comment "/**\n * Handles 'X' cases\n */"
method_declaration (+194 nodes collapsed)
block_comment "/**\n * Handles 'Z' cases\n */"
method_declaration (+204 nodes collapsed)
line_comment "//-- BEGIN CONDITIONS --//"
block_comment "/**\n * Complex condition 0 for 'C'\n */"
method_declaration (+188 nodes collapsed)
block_comment "/**\n * Complex condition 0 for 'CH'\n */"
method_declaration (+146 nodes collapsed)
block_comment "/**\n * Complex condition 1 for 'CH'\n */"
method_declaration (+205 nodes collapsed)
block_comment "/**\n * Complex condition 0 for 'L'\n */"
method_declaration (+178 nodes collapsed)
block_comment "/**\n * Complex condition 0 for 'M'\n */"
method_declaration (+110 nodes collapsed)
line_comment "//-- BEGIN HELPER FUNCTIONS --//"
block_comment "/**\n * Determines whether or not a value is of slavo-ger"...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Determines whether or not a character is a vowel "...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Determines whether or not the value starts with a"...
method_declaration (+80 nodes collapsed)
block_comment "/**\n * Cleans the input\n */"
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Gets the character at index <code>index</code> if"...
method_declaration (+62 nodes collapsed)
block_comment "/**\n * Shortcut method with 1 criteria\n */"
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Shortcut method with 2 criteria\n */"
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Shortcut method with 3 criteria\n */"
method_declaration (+65 nodes collapsed)
block_comment "/**\n * Shortcut method with 4 criteria\n */"
method_declaration (+71 nodes collapsed)
block_comment "/**\n * Shortcut method with 5 criteria\n */"
method_declaration (+77 nodes collapsed)
block_comment "/**\n * Shortcut method with 6 criteria\n */"
method_declaration (+83 nodes collapsed)
block_comment "/**\n * Determines whether <code>value</code> contains an"...
method_declaration (+145 nodes collapsed)
line_comment "//-- BEGIN INNER CLASSES --//"
block_comment "/**\n * Inner class for storing results, since there is t"...
class_declaration (+596 nodes collapsed)
} "}"