Skip to content

Commit

Permalink
Rewrote skipwords list.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed May 9, 2010
1 parent 47fcc57 commit 05b7c8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
23 changes: 1 addition & 22 deletions data/wordlists/skipwords
@@ -1,5 +1,3 @@
I
A
ABLE
ABOUT
ACCOUNT
Expand Down Expand Up @@ -88,12 +86,10 @@ BOX
BOY
BRAIN
BRAKE
BRANCH
BRASS
BREAD
BREATH
BRICK
BRIDGE
BRIGHT
BROKEN
BROTHER
Expand Down Expand Up @@ -223,7 +219,6 @@ DUST
EAR
EARLY
EARTH
EAST
EDGE
EDUCATION
EFFECT
Expand Down Expand Up @@ -262,7 +257,6 @@ FEELING
FEMALE
FERTILE
FICTION
FIELD
FIGHT
FINGER
FIRE
Expand Down Expand Up @@ -291,7 +285,6 @@ FREE
FREQUENT
FRIEND
FROM
FRONT
FRUIT
FULL
FUTURE
Expand Down Expand Up @@ -346,7 +339,6 @@ HORN
HORSE
HOSPITAL
HOUR
HOUSE
HOW
HUMOUR
ICE
Expand Down Expand Up @@ -470,13 +462,11 @@ NEED
NEEDLE
NERVE
NET
NEW
NEWS
NIGHT
NO
NOISE
NORMAL
NORTH
NOSE
NOT
NOTE
Expand Down Expand Up @@ -525,7 +515,6 @@ PICTURE
PIG
PIN
PIPE
PLACE
PLANE
PLANT
PLATE
Expand All @@ -536,7 +525,6 @@ PLOUGH
POCKET
POINT
POISON
POLISH
POLITICAL
POOR
PORTER
Expand Down Expand Up @@ -597,8 +585,6 @@ RHYTHM
RICE
RIGHT
RING
RIVER
ROAD
ROD
ROLL
ROOF
Expand Down Expand Up @@ -684,14 +670,12 @@ SONG
SORT
SOUND
SOUP
SOUTH
SPACE
SPADE
SPECIAL
SPONGE
SPOON
SPRING
SQUARE
STAGE
STAMP
STAR
Expand All @@ -715,7 +699,6 @@ STORE
STORY
STRAIGHT
STRANGE
STREET
STRETCH
STRONG
STRUCTURE
Expand Down Expand Up @@ -743,7 +726,6 @@ TENDENCY
TEST
THAN
THAT
THE
THEN
THEORY
THERE
Expand Down Expand Up @@ -804,15 +786,12 @@ WARM
WASH
WASTE
WATCH
WATER
WAVE
WAX
WAY
WEATHER
WEEK
WEIGHT
WELL
WEST
WET
WHEEL
WHEN
Expand Down Expand Up @@ -847,4 +826,4 @@ YELLOW
YES
YESTERDAY
YOU
YOUNG
YOUNG
15 changes: 10 additions & 5 deletions safecity/apps/locate/management/commands/vet_skipwords.py
Expand Up @@ -16,6 +16,11 @@ class Command(NoArgsCommand):
title = 'locate.vet_skip_words'
help = 'Verify that no skip_words are road names or other keywords.'

option_list = NoArgsCommand.option_list + (
make_option('-r', '--rewrite', action='store_true', dest='rewrite',
help='Rewrite skipwords list without problem words.'),
)

def handle_noargs(self, **options):
skip_words = []

Expand Down Expand Up @@ -44,7 +49,6 @@ def handle_noargs(self, **options):
rewrite = skip_words

for word in skip_words:
# Check against road types
if word in road_types:
log.error('Word "%s" is also a road type.' % word)
rewrite.remove(word)
Expand All @@ -70,8 +74,9 @@ def handle_noargs(self, **options):
log.error('Word "%s" is also a part of road alias "%s".' % (word, alias.name))
rewrite.remove(word)
break

log.info('Rewriting skip_words list without problem words')

with open(os.path.join(settings.DATA_DIR, 'wordlists/skipwords')) as f:
f.write('\n'.join(rewrite))
if options['rewrite']:
log.info('Rewriting skip_words list without problem words')

with open(os.path.join(settings.DATA_DIR, 'wordlists/skipwords'), 'w') as f:
f.write('\n'.join(rewrite))

0 comments on commit 05b7c8e

Please sign in to comment.