Skip to content

Commit

Permalink
Warning for out-of-order words in dawgbuilder.py
Browse files Browse the repository at this point in the history
Clarification in README.md
  • Loading branch information
vthorsteinsson committed Jul 28, 2015
1 parent aee45b6 commit d92ee6c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@ The word database is in ```resources/ordalisti.text.dawg```.
with or endorsed by the owners or licensees of the SCRABBLE trademark.*

### To build and run locally
Download the [Google App Engine SDK](https://cloud.google.com/appengine/downloads) for Python.
Run ```npm install``` to install node dependencies
Run ```grunt watch``` (only creates files on changes).
Run ```python dawgbuilder.py``` to generate the DAWG .pickle files
Run ```pip install -t lib -r requirements.txt``` to install Python packages for Google Apps to use
Create a bogus secret key in `resources/secret_key.bin`
Run either ```runserver.bat``` or ```runserver.sh```.

1. Download the [Google App Engine SDK](https://cloud.google.com/appengine/downloads) for Python.

2. Run ```npm install``` to install node dependencies.

3. Run ```grunt watch```. Note that some release files, i.e. ```*.css``` and ```*.min.js``` are only created when the corresponding source files, i.e. ```*.less``` and ```*.js```, are modified.

4. Run ```python dawgbuilder.py``` to generate the DAWG ```*.pickle``` files.

5. Run ```pip install -t lib -r requirements.txt``` to install Python packages for Google Apps to use.

6. Create a secret session key for Flask in `resources/secret_key.bin` (see [How to generate good secret keys](http://flask.pocoo.org/docs/0.10/quickstart/), you need to scroll down to find the heading).

7. Run either ```runserver.bat``` or ```runserver.sh```.

### Author
Vilhjalmur Thorsteinsson
Expand Down
5 changes: 4 additions & 1 deletion dawgbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,10 @@ def _load(self, relpath, inputs, removals, localeid, filter):
# Something appears to be wrong with the input sort order.
# If it's a duplicate, we don't mind too much, but if it's out
# of order, display a warning
if locale.strcoll(lastword, word) <= 0:
if locale.strcoll(lastword, word) > 0:
print(u"Warning: input files should be in ascending order, but \"{0}\" > \"{1}\"".format(lastword, word))
else:
# Identical to previous word
duplicates += 1
elif (filter is None) or filter(word):
# This word passes the filter: check the removal list, if any
Expand Down

0 comments on commit d92ee6c

Please sign in to comment.