update README, and consider repository finished (at least for now)

This commit is contained in:
2024-09-11 13:19:41 +01:00
parent db8fa8ae80
commit 0dda4dc974
15 changed files with 154 additions and 8 deletions

View File

@@ -78,9 +78,25 @@ struct
end
| _ => raise Match
fun helpStartsWith (pos, prefix, key) =
if pos = String.size prefix then
true
else
let
val prefixChr = String.sub (prefix, pos)
val keyChr = String.sub (key, pos)
in
if keyChr = prefixChr then helpStartsWith (pos + 1, prefix, key)
else false
end
fun startsWith (prefix, key) =
if String.size prefix > String.size key then false
else helpStartsWith (0, prefix, key)
fun getPrefixList (prefix, tree) =
foldr
( (fn (k, acc) => if String.isSubstring prefix k then k :: acc else acc)
( (fn (k, acc) => if startsWith (prefix, k) then k :: acc else acc)
, []
, tree
)

BIN
bench/build-exists-bro-tree Executable file

Binary file not shown.

View File

@@ -23,7 +23,8 @@ struct
val finishTime = Time.now ()
val searchDuration = Time.- (finishTime, startTime)
val searchDuration = Time.toString searchDuration ^ "\n"
val searchDuration = Time.toMilliseconds searchDuration
val searchDuration = LargeInt.toString searchDuration ^ "\n"
in
print searchDuration
end

BIN
bench/build-exists-string-set Executable file

Binary file not shown.

View File

@@ -24,7 +24,8 @@ struct
val finishTime = Time.now ()
val searchDuration = Time.- (finishTime, startTime)
val searchDuration = Time.toString searchDuration ^ "\n"
val searchDuration = Time.toMilliseconds searchDuration
val searchDuration = LargeInt.toString searchDuration ^ "\n"
in
print searchDuration
end

BIN
bench/build-get-prefix-bro-tree Executable file

Binary file not shown.

View File

@@ -0,0 +1,10 @@
$(SML_LIB)/basis/basis.mlb
ann
"allowVectorExps true"
in
words.sml
end
bro-tree.sml
build-get-prefix-bro-tree.sml

View File

@@ -0,0 +1,20 @@
structure BuildGetPrefixBroTree =
struct
fun main () =
let
val endTrie =
Vector.foldl BroTree.insert BroTree.empty WordsList.words
val startTime = Time.now ()
val lst = BroTree.getPrefixList ("a", endTrie)
val finishTime = Time.now ()
val searchDuration = Time.- (finishTime, startTime)
val searchDuration = Time.toNanoseconds searchDuration
val searchDuration = LargeInt.toString searchDuration ^ " ns\n"
in
print searchDuration
end
end
val _ = BuildGetPrefixBroTree.main ()

BIN
bench/build-get-prefix-string-set Executable file

Binary file not shown.

View File

@@ -0,0 +1,10 @@
$(SML_LIB)/basis/basis.mlb
ann
"allowVectorExps true"
in
words.sml
end
../src/string-set.sml
build-get-prefix-string-set.sml

View File

@@ -0,0 +1,20 @@
structure BuildGetPrefixStringSet =
struct
fun main () =
let
val endTrie =
Vector.foldl StringSet.insert StringSet.empty WordsList.words
val startTime = Time.now ()
val lst = StringSet.getPrefixList ("a", endTrie)
val finishTime = Time.now ()
val searchDuration = Time.- (finishTime, startTime)
val searchDuration = Time.toNanoseconds searchDuration
val searchDuration = LargeInt.toString searchDuration ^ " ns\n"
in
print searchDuration
end
end
val _ = BuildGetPrefixStringSet.main ()

BIN
bench/conv-words Executable file

Binary file not shown.

BIN
bench/insert-bro-tree Executable file

Binary file not shown.

BIN
bench/insert-string-set Executable file

Binary file not shown.