Skip to content

Direct Acrylic Word Graph & UnScramble JavaScript Web Page.

License

Notifications You must be signed in to change notification settings

ztalbot2000/DAWG-UnScramble

Repository files navigation

UnScramble - Direct Acrylic Word Graph & UnScramble JavaScript Web Page.

About the Tool Set

DAWG-UnScramble is a complete tool set with a speedy 'C' word list pre-processor and an HTML/JavaScript front end. The main emphasis is on the pre-processor, it is not only capable of creating a DAWG, but also reversing the DAWG back into the original word list.

The HTML/Javascript front end has only been tested on Safari and a working copy can be found at Unscramble (No Ads)

Tag V1 Bug versus V2+

Since version 2, UnScramble uses npm & webpack to install dependancies required for handling modern web browser ACL permisions and/or Origin requests when trying to read in its binary dictionary file. UnScramble version 1 failed to load the binary dictiinary file and when searching for words would do nothhing. The "Must Contain" selection button would just show "Blast".

Development

UnScramble uses npm & webpack to install dependancies. Install dependancies with:

  • npm install --save-dev

How to use the DAWG Pre-Processor

  • mkdir -p bin
  • gcc src/c/UnScramble.c -o bin/UnScramble
  • ./bin/UnScramble -h
  • ./bin/Unscramble -i sr/datafiles/Lexicon.txt -o /tmp/DAWG_SOWPODS.English.dat

for more descriptive logs use option -d <0-3>

  • ./bin/Unscramble -d 1 -i sr/datafiles/Lexicon.txt -o /tmp/DAWG_SOWPODS.English.dat

or

  • npm run cbuild

Modern Web Browsers as of Jan 2023

UnScramble.html used to read in the dictionary directly via XMLHttpRequest of ./datafiles/DAWG_SOWPODS_English.dat. See files under tag v1.0
With modern browsers this is an ACL and/or Origin security risk. To get around this the resultant DAWG is bin64 encoded and then decoded back into its binary form. The final resultant file is included in UnScramble.html with:

<SCRIPT SRC="datafiles/DAWG_SOWPODS_English_base64.js"></SCRIPT>

How to use the DAWG Data to base64 Pre-Processor

As mentioned modern web browsers cannot read local binary files. It first must be converted from binary to base64 encoding with:.

  • node tools/scripts/DAWGDatToBin64JSVar.js -h
  • node tools/scripts/DAWGDatToBin64JSVar.js -v base64Dict -i /tmp/DAWG_SOWPODS_English.dat -o /tmp/DAWG_SOWPODS_English_base64.js

or

  • npm run build:dat64_E

Local Testing

UnScramble uses webpack-dev-server. To try UnScramble locally run:

  • npm run devServer

Real Web Server Installation

The resultant files should be placed on your Web server in the following configuration.
UnScramble.html
js/UnScramble.js
datafiles/DAWG_SOWPODS_English_base64.js
images/Letter-30x20.png
images/background.png

Screenshots

Inspiration

  • I sharpenned my teeth here, but I needed more.

License

See LICENSE

About

Direct Acrylic Word Graph & UnScramble JavaScript Web Page.

Resources

License

Stars

Watchers

Forks

Packages

No packages published