Skip to content

Commit

Permalink
Updated robot descriptions and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vthorsteinsson committed Jan 21, 2021
1 parent b0e64b7 commit 1a03666
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ Run ```./setup-dev.sh``` (tested on Debian based Linux and OS X).

### Generating a new vocabulary file

To generate a new vocabulary file (```ordalistimax15.sorted.txt```), assuming you already
have the BÍN database in PostgreSQL (here in table ```ord19``` - remember to use the
To generate a new vocabulary file (```ordalisti.full.sorted.txt```), assuming you already
have the BÍN database in PostgreSQL (here in table ```sigrunarsnid``` - remember to use the
```is_IS``` collation locale!), invoke ```psql```, log in to your database and
create the following view:

```sql
create or replace view skrafl as
select stofn, utg, ordfl, fl, ordmynd, beyging from ord19
select stofn, utg, ordfl, fl, ordmynd, beyging from sigrunarsnid
where ordmynd ~ '^[aábdðeéfghiíjklmnoóprstuúvxyýþæö]{3,15}$'
and fl <> 'bibl'
and not ((beyging like 'SP-%-FT') or (beyging like 'SP-%-FT2'))
Expand All @@ -113,9 +113,23 @@ forms (*spurnarmyndir í fleirtölu*).
Then, to generate the vocabulary file from the ```psql``` command line:

```sql
\copy (select distinct ordmynd from skrafl) to '/home/username/github/Netskrafl/resources/ordalistimax15.sorted.txt';
\copy (select distinct ordmynd from skrafl) to '/home/username/github/Netskrafl/resources/ordalisti.full.sorted.txt';
```

To extract only the subset of BÍN used by the robot *Miðlungur*, use the following
view, assuming you have the *Kristínarsnið* form of BÍN in the table ```kristinarsnid```
containing the ```malsnid``` and ```einkunn``` columns:

```sql
create or replace view skrafl_midlungur as
select stofn, utg, ordfl, fl, ordmynd, beyging
from kristinarsnid
where (malsnid is null or (malsnid <> ALL (ARRAY['SKALD', 'FORN', 'URE', 'STAD'])))
and einkunn > 0;
```

You can then use the ```skrafl_midlungur``` view as the underlying table for the previous
(vocabulary) query, replacing ```sigrunarsnid``` with ```skrafl_midlungur```.

### Original Author
Vilhjálmur Þorsteinsson, Reykjavík, Iceland.
Expand Down
2 changes: 1 addition & 1 deletion skraflgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ class Game:
),
(
"Miðlungur",
"Velur af handahófi einn af 8 stigahæstu leikjum í hverri stöðu",
"Forðast allra sjaldgæfustu orðin; velur úr 10 stigahæstu leikjum",
8,
),
(
Expand Down
19 changes: 12 additions & 7 deletions templates/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,22 @@
<span class="glyphicon glyphicon-cog"></span> Amlóða?

<p><b><span class="glyphicon glyphicon-cog"></span> Fullsterkur</b> velur
alltaf stigahæsta leik sem mögulegur er í hverri stöðu.</p>
<p><b><span class="glyphicon glyphicon-cog"></span> Miðlungur</b> velur
af handahófi einn af átta stigahæstu leikjunum sem mögulegir eru.</p>
alltaf stigahæsta leik sem mögulegur er í hverri stöðu. Hann hugsar hins vegar
ekki taktískt, og lætur sér til dæmis í léttu rúmi liggja hvort lögn opnar fyrir
að andstæðingurinn leggi á rauðan reit.</p>
<p><b><span class="glyphicon glyphicon-cog"></span> Miðlungur</b> forðast
allra sjaldgæfustu orðin í orðasafninu og velur
af handahófi einn af tíu stigahæstu leikjunum sem mögulegir eru.</p>
<p><b><span class="glyphicon glyphicon-cog"></span> Amlóði</b> forðast
sjaldgæf orð og velur úr 20 leikjum sem koma til álita.</p>
<p><b><span class="glyphicon glyphicon-cog"></span> Fullsterkur</b> og
<b><span class="glyphicon glyphicon-cog"></span> Miðlungur</b> hafa úr sama
<p><b><span class="glyphicon glyphicon-cog"></span> Fullsterkur</b> hefur úr sama
orðaforða að moða og leikmenn almennt, þ.e. orð úr BÍN sem samræmast skraflreglum
auk orða sem Orðanefnd hefur ákveðið að séu leyfileg.
auk orða sem Orðanefnd hefur ákveðið að séu leyfileg.</p>
<p><b><span class="glyphicon glyphicon-cog"></span> Miðlungur</b> kann um það
bil 95% af orðaforða BÍN, en hefur ekki á takteinum orð sem merkt eru sem forn,
úrelt, sjaldgæf eða staðbundin.</p>
<b><span class="glyphicon glyphicon-cog"></span> Amlóði</b> hefur hins vegar
minni orðaforða en hinir þjarkarnir. Orðaforði hans er um það bil fjórðungur
töluvert minni orðaforða en hinir þjarkarnir. Orðaforði hans er um það bil fjórðungur
af aðalgrunninum. Þótt orðaforði Amlóða sé takmarkaður getur þú eftir sem áður
lagt niður öll leyfileg orð gegn honum.</p>
</li>
Expand Down

0 comments on commit 1a03666

Please sign in to comment.