Skip to content

Commit

Permalink
Merge pull request #318 from domino14/fix_polish_again
Browse files Browse the repository at this point in the history
fixing polish dictionary to be OSPS40
  • Loading branch information
domino14 authored Apr 24, 2019
2 parents c10235b + 8d8d06a commit e2f1271
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions djAerolith/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def getLexicon(request=None):
return Lexicon.objects.get(lexiconName='NWL18')
elif request.LANGUAGE_CODE == 'es':
return Lexicon.objects.get(lexiconName='FISE2')
elif request.LANGUAGE_CODE == 'pl':
return Lexicon.objects.get(lexiconName='OSPS40')
return Lexicon.objects.get(lexiconName='NWL18')


Expand Down
7 changes: 3 additions & 4 deletions djAerolith/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
'America',
]

# XXX: This handles both the Spanish and English case, but alphagrammize
# will need to be reworked with lexicon-specific ordering if we add
# non-latin letters.
SORT_STRING_ORDER = 'ABC1DEFGHIJKL2MNÑOPQR3STUVWXYZ?'
# XXX: This handles Spanish, English and Polish. It is pretty ghetto.
# Consider reworking with lexicon-specific reordering (see macondo e.g.)
SORT_STRING_ORDER = 'AĄBCĆ1DEĘFGHIJKLŁ2MNŃÑOÓPQR3SŚTUVWXYZŹŻ?'
SORT_MAP = {}


Expand Down
1 change: 1 addition & 0 deletions djAerolith/djaerolith/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def tobool(val):
LANGUAGES = [
('en', _('English')),
('es', _('Spanish')),
('pl', _('Polish')),
]

SITE_ID = 1
Expand Down
1 change: 1 addition & 0 deletions djAerolith/flashcards/templates/flashcards/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h4 class="modal-title">Look up Word</h4>
<option>NWL18</option>
<option>CSW15</option>
<option>FISE2</option>
<option>OSPS40</option>
</select>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions djAerolith/wordwalls/fixtures/test/lexica.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
model: base.lexicon
pk: 10
- fields:
lengthCounts: '{"10":287145,"11":327427,"12":336526,"13":318775,"14":281324,"15":229153,"2":100,"3":1107,"4":5194,"5":17853,"6":43367,"7":89363,"8":153158,"9":224471}'
lengthCounts: '{"10":290522,"11":331232,"12":339846,"13":321838,"14":283230,"15":230698,"2":100,"3":1107,"4":5198,"5":17913,"6":43642,"7":90127,"8":155129,"9":227533}'
lexiconDescription: "Polska Federacja Scrabble - Update 38"
lexiconName: OSPS38
lexiconName: OSPS40
model: base.lexicon
pk: 11
3 changes: 2 additions & 1 deletion djAerolith/wordwalls/management/commands/genNamedLists.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def create_spanish_lists():


def create_polish_lists():
lex = Lexicon.objects.get(lexiconName='OSPS38')
lex = Lexicon.objects.get(lexiconName='OSPS40')
db = WordDB(lex.lexiconName)
for i in range(2, 16):
logger.debug('Creating WL for lex %s, length %s', lex.lexiconName, i)
Expand Down Expand Up @@ -356,4 +356,5 @@ def handle(self, **options):
# lexiconName__in=['NWL18']):
# createNamedLists(lex)
# create_spanish_lists()
NamedList.objects.filter(lexicon__lexiconName='OSPS40').delete()
create_polish_lists()

0 comments on commit e2f1271

Please sign in to comment.