18-05-2016, 12:32 PM
(This post was last modified: 18-05-2016, 12:34 PM by Torsten.
Edit Reason: function names marked with '
)
For comparing two words a modified implemenation of the Damerau-Levenshtein distance is used (see You are not allowed to view links. Register or Login to view. and You are not allowed to view links. Register or Login to view.). The idea behind the Levenshtein-algorithm is to count the number of steps needed to transform one word into another one (see also Torsten Timm, 2014, How the Voynich Manuscript was created, p. 6 - You are not allowed to view links. Register or Login to view.).
To consider the peculiarities of the VMS script, a function 'isSimilar()' in line 41 in Levenshtein.swift was added. This function determines if two glyphs are similar or not (see
You are not allowed to view links. Register or Login to view.). The map 'similarGlyphsMap' defines which glyphs are similar to each other (see You are not allowed to view links. Register or Login to view.).
If a glyph is deleted, added or replaced by a similar glyph, this is counted as one change. If a glyph is replaced by a non-similar glyph, this is treated as deleting one glyph and adding another glyph. For instance, since 'l' is similar to 'r' the distance between 'chol' and 'chor' is one. And since 'l' is not similar to 'k' the distance between 'chol' and 'chok' is two.
Another example is the calculation of the distance between 'chol' and 'chlor'. The Damerau-Levenshtein distance handels the transposition of two characters as one change. Therefore the replacement of 'ol' with 'lo' counts as one change. Secondly there is an additional glyph 'r'. This also counts as one change. Therefore at least two changes are needed to transform 'chol' into 'chlor' ('chol' -> 'chlo' -> 'chlor' or 'chol' -> 'chor' -> 'chlor'). The edit distance for 'chol' and 'chlor' is therefore two.
For perfomance reasons the distances for all similar words to 'chol' are stored as 'chol_distanceMap' in SimilarResults.swift. This map shows that for 'chol' 33 similar words with an edit distance of one and 218 words with an edit distance of two exists.
See You are not allowed to view links. Register or Login to view.:
let chol_distanceMap: Dictionary<String, Int> = [
"shol" : 1,
"shod" : 2,
"otchol" : 2,
"chor" : 1,
"cfhol" : 1,
"ol" : 2,
"chol" : 0,
"chal" : 1,
To consider the peculiarities of the VMS script, a function 'isSimilar()' in line 41 in Levenshtein.swift was added. This function determines if two glyphs are similar or not (see
You are not allowed to view links. Register or Login to view.). The map 'similarGlyphsMap' defines which glyphs are similar to each other (see You are not allowed to view links. Register or Login to view.).
If a glyph is deleted, added or replaced by a similar glyph, this is counted as one change. If a glyph is replaced by a non-similar glyph, this is treated as deleting one glyph and adding another glyph. For instance, since 'l' is similar to 'r' the distance between 'chol' and 'chor' is one. And since 'l' is not similar to 'k' the distance between 'chol' and 'chok' is two.
Another example is the calculation of the distance between 'chol' and 'chlor'. The Damerau-Levenshtein distance handels the transposition of two characters as one change. Therefore the replacement of 'ol' with 'lo' counts as one change. Secondly there is an additional glyph 'r'. This also counts as one change. Therefore at least two changes are needed to transform 'chol' into 'chlor' ('chol' -> 'chlo' -> 'chlor' or 'chol' -> 'chor' -> 'chlor'). The edit distance for 'chol' and 'chlor' is therefore two.
For perfomance reasons the distances for all similar words to 'chol' are stored as 'chol_distanceMap' in SimilarResults.swift. This map shows that for 'chol' 33 similar words with an edit distance of one and 218 words with an edit distance of two exists.
See You are not allowed to view links. Register or Login to view.:
let chol_distanceMap: Dictionary<String, Int> = [
"shol" : 1,
"shod" : 2,
"otchol" : 2,
"chor" : 1,
"cfhol" : 1,
"ol" : 2,
"chol" : 0,
"chal" : 1,

