Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added example file

  • Loading branch information...
commit 30906f6bf189510ada5cef86c1c808e41d232b95 1 parent c1febe3
Henrik Hinrichs authored
Showing with 54 additions and 3 deletions.
  1. +51 −0 example.txt
  2. +3 −3 wordparser.js
51 example.txt
View
@@ -0,0 +1,51 @@
+AA
+AAH
+AAHED
+AAHING
+AAHS
+AAL
+AALII
+AALIIS
+AALS
+AARDVARK
+AARDVARKS
+AARDWOLF
+AARDWOLVES
+ANALYSTS
+NEROTIC
+NEUROANATOMICAL
+NEURON
+ZYMOID
+ZYMOLOGIC
+ZYMOLOGICAL
+ZYMOLOGIES
+ZYMOLOGIST
+ZYMOLOGISTS
+ZYMOLOGY
+ZYMOLYSES
+ZYMOLYSIS
+ZYMOLYTIC
+ZYMOME
+ZYMOMES
+ZYMOMETER
+ZYMOMETERS
+ZYMOSAN
+ZYMOSANS
+ZYMOSES
+ZYMOSIMETER
+ZYMOSIMETERS
+ZYMOSIS
+ZYMOTECHNIC
+ZYMOTECHNICAL
+ZYMOTECHNICS
+ZYMOTIC
+ZYMOTICALLY
+ZYMOTICS
+ZYMURGIES
+ZYMURGY
+ZYTHUM
+ZYTHUMS
+ZYZZYVA
+ZYZZYVAS
+ZZZ
+ZZZS
6 wordparser.js
View
@@ -34,7 +34,7 @@ var fs = require("fs");
// <linkname=type> > link to that definition
// {linkname=type} > include that definitions text
-var wordFile = "sowpods.txt";
+var wordFile = "example.txt";
var isWord = function(wordTree, letters) {
@@ -94,14 +94,14 @@ var createWordTree = function(wordList) {
}
console.log("...done (", words, "words ) (", endTimer("parse"), "ms )");
- // some tests
+ // speed test
startTimer("find");
for (var i = 0; i < 100000; i++) {
isWord(wordTree, "NEUROANATOMICAL");
}
console.log("...done checking (", endTimer("find"), "ms )");
- startTimer("find");
+ // persisting
startTimer("create json");
var json = JSON.stringify(wordTree);
console.log("...done creating json (", json.length, "bytes ) (", endTimer("create json"), "ms )");
Please sign in to comment.
Something went wrong with that request. Please try again.