Calculates various forms of soundex (English) including:
SoundexNARA - soundex as prescribed by the U.S. National Archives & Records Administration (Census) SoundexNum - (old school) soundex with numbers only result LevenshteinDistance - Evaluates how many additions/subtractions/substitutions are needed to make the strings identical DamerauLevenshteinDistance - Same as LevenshteinDistance, but also accounts for transposed (switched & adjacent) characters
Can someone please say me what i'm missing here?
this little problem is driving me crazy!
i feel so stupid that i have to ask this but why does this script thinks that "=" doesn't exist inside the dictionary?
$regex = ObjCreate("VBScript.RegExp") $regex.Pattern = "=" $regex.Global = True $regex.IgnoreCase = True $test = ObjCreate("scripting.dictionary") $test.add("=", 2) $sentence = "=" Local $find = $regex.execute($sentence) for $part in $find msgbox(0,1,$part.Value) MsgBox(0,2,$part.Value = "=") MsgBox(0,3,$test.exists("=")) msgbox(0,4,$test.exists($part)) ;this should be true! next
Thanks for any help
If you don't like dealing with Scripting.dictionary you might want to try out this thing I whipped up yesterday evening and this morning.
Basically just a simple wrapper around Scripting.dictionary to make the API a little bit less stupid. By "stupid" I mean "not like the awesome Python dict API".
Created for the following reasons..
Wanted to get a basic understanding of AutoItObject. Wanted to get a basic understanding of the Micro unit test framework. As of 11/4/2014 AutoIt Stable has no native dict or associative array type. A >Map type is in the current AutoIt beta. It's laborious to use Scripting.dictionary all the time. The Python dict API is better than Scripting.dictionary's I thought about writing my own hash table implementation in AutoIt, but on balance I decided it wasn't worth the effort and just stuck to Scripting.dictionary to save time/effort.
As you can see I've got a decent number of unit tests for such a simple implementation, so it should be quite robust.
#include <Dict2.au3> #include <Array.au3> $dict = _DictCreate() ConsoleWrite($dict.len()) ; Outputs 0 $dict.set("key1", "value1") $dict.set("key2", "value2") $dict.set("key3", "value3") $dict.set("key4", 1) ConsoleWrite($dict.get("key2")) ; Outputs 'value2' ConsoleWrite($dict.len()) ; Outputs 3 ConsoleWrite($dict.contains("key2") ; Outputs True $dict.set("key4", $dict.get("key4") + 1) ConsoleWrite($dict.get("key4")) ; Outputs 2 $dict.del("key4") ConsoleWrite($dict.contains("key4")) ; Outputs False $aPairs = $dict.pairs() _ArrayDisplay($aPairs) ; Displays 2d array with column one contains keys, and column two ; containing associated values $aKeys = $dict.keys() _ArrayDisplay($aKeys) ; Displays array containing all keys $aValues = $dict.values() _ArrayDisplay($aValues) ; Displays array of all values $aDesiredKeys = ["key1", "key3"] $aValues = $dict.values($aDesiredKeys) _ArrayDisplay($aValues) ; Displays array of values for key1 and key3 GET IT HERE