# מילון מרוץ המילים

`he.txt` is the dictionary of מרוץ המילים (Word Rush). It has one word per line in the form `word,count`, most common first. There are about 185,000 Hebrew word forms: nouns, adjectives and verbs with their inflections, plurals and possessive forms.

## Where it comes from

- **Hspell 1.4** by Nadav Har'El and Dan Kenigsberg (http://hspell.ivrix.org.il/). Every word form comes from Hspell.
- **[eyaler/hebrew_wordlists](https://github.com/eyaler/hebrew_wordlists)**, file `cc100_intersect_no_fatverb.csv`. These are Hspell word forms that also appear in the CC-100 web corpus. The file adds two things:
  - The count is how often the form appears in CC-100.
  - Forms with a prefix (ה, ו, ב, ל and so on) are left out, as are verbs with an attached object pronoun.

## How `build.mjs` filters the list

1. It keeps only the 22 Hebrew letters, 3 to 16 letters per word.
2. A final letter (ך ם ן ף ץ) may appear only at the end of a word. A plain כ מ נ פ צ is never accepted at the end.
3. It removes proper nouns, using Hspell's own sources:
   - The name, place, month, country, myth and acronym sections of `extrawords.hif`.
   - The country names that `wolig.dat` derives from nationality adjectives.
   - A name that is also an ordinary noun stays in the list, for example שלום, מלכים and אורן.
4. It drops the words listed in `blocked.txt` and adds the words listed in `allowed.txt`. The added words are mostly the 2017 Academy spellings, which Hspell does not have yet: אמיתי, בריכה, סיסמה and similar.

The game server reads `he.txt`, `blocked.txt` and `allowed.txt` every time it starts. After editing either word list, restarting the server is enough to apply the change. A full rebuild is needed only when the source list changes:

```
node shared/dict/build.mjs cc100_intersect_no_fatverb.csv hspell-1.4/extrawords.hif hspell-1.4/wolig.dat
```

## Rules the game applies

- A word needs at least 3 letters.
- Prefixes are not accepted: הבית does not count, but בית does.
- A board letter can stand for its final form at the end of a word, so מ at the end reads as ם. Inside a word it is always the plain letter.
- Niqqud and cantillation marks are ignored.
- Every word in the list scores points. The game uses only the more common words (count of 1000 or more) for two things:
  - checking that a board is good enough to play;
  - choosing the words shown in "words nobody found".

## License

Hspell and every word list generated from it, including this one, are released under the **GNU Affero General Public License v3**. The full text is in `COPYING`.

The word list and the code that builds it are published at https://dogriai.com/chavura/words/ for anyone who plays the game. Hspell copyright (C) 2000-2017 Nadav Har'El and Dan Kenigsberg.
