Skip to content

Commit

Permalink
Merge pull request #337 from domino14/default-lex
Browse files Browse the repository at this point in the history
set default lexicon to NWL23
  • Loading branch information
domino14 committed May 30, 2024
2 parents c07b4e3 + 60c8221 commit 6d48552
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cgp/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ParseCGP(cfg *config.Config, cgpstr string) (*ParsedCGP, error) {
// These are our defaults, but they can be overridden by operations.
boardLayoutName := "CrosswordGame"
letterDistributionName := "english"
lexiconName := "NWL20"
lexiconName := "NWL23"
maxScorelessTurns := game.DefaultMaxScorelessTurns
variant := game.VarClassic
gid := ""
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func DefaultConfig() Config {
c.AutomaticEnv()
c.SetEnvPrefix("macondo")

c.SetDefault(ConfigDefaultLexicon, "NWL20")
c.SetDefault(ConfigDefaultLexicon, "NWL23")
c.SetDefault(ConfigDefaultLetterDistribution, "English")
c.SetDefault(ConfigTtableMemFraction, 0.25)
// Read from an env var MACONDO_DATA_PATH. This might not be a good way to do it:
Expand Down Expand Up @@ -84,7 +84,7 @@ func (c *Config) Load(args []string) error {
c.BindEnv(ConfigMEMProfile)

c.SetDefault(ConfigDataPath, "./data") // will be fixed by toAbsPath below if unspecified.
c.SetDefault(ConfigDefaultLexicon, "NWL20")
c.SetDefault(ConfigDefaultLexicon, "NWL23")
c.SetDefault(ConfigDefaultLetterDistribution, "English")
c.SetDefault(ConfigTtableMemFraction, 0.25)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Tutorial video: [https://youtu.be/MOyzyKskr_4](https://youtu.be/MOyzyKskr_4)
## How to use

1. Open the executable. If you wish your default lexicon to be CSW21, you
must set the environment variable `DEFAULT_LEXICON` to `CSW21`. Otherwise, it defaults to NWL20. In this case you can set your lexicon by typing in `set lexicon CSW21` into the macondo prompt.
must set the environment variable `DEFAULT_LEXICON` to `CSW21`. Otherwise, it defaults to NWL23. In this case you can set your lexicon by typing in `set lexicon CSW21` into the macondo prompt.

2. Move some `*.kwg` files for your desired lexicon to the `./data/lexica/gaddag` folder. You can find kwg files at [https://github.com/woogles-io/liwords/blob/master/liwords-ui/public/wasm](https://github.com/woogles-io/liwords/blob/master/liwords-ui/public/wasm)

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/autoplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ its basic use case, without any arguments, `autoplay` will use two
"exhaustive leave" players - i.e. computer players that use 1-to-6 tile
leave values to calculate equity.

The NWL20 leave values can be found in `./data/strategy/NWL20/leaves.klv2`. Slightly different values for CSW21 are found in `./data/strategy/CSW21/leaves.klv2`.
The NWL23 leave values can be found in `./data/strategy/NWL23/leaves.klv2`. Slightly different values for CSW21 are found in `./data/strategy/CSW21/leaves.klv2`.

See [How to make leaves and GADDAG files](/macondo/manual/make_leaves_structure.html) for how
this file was created.
Expand Down
14 changes: 5 additions & 9 deletions docs/manual/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
- [Back to Manual](/macondo/manual)
- [Back to Main Page](/macondo)

# Tips
# Tips

## How to use other languages

NWL20 is currently the default lexicon of Macondo.
NWL23 is currently the default lexicon of Macondo.

If you wish to use other lexica, you will need to also
change the environment variable `DEFAULT_LETTER_DISTRIBUTION` to other values: `spanish`, `polish`, `german`, `norwegian`, `french`, `catalan`, `polish`. There will be more in the future.
If you wish to use other lexica, you can just use `set lexicon OSPS42 polish` inside the Macondo shell, for example. The first argument is the lexicon name; the second argument is the letter distribution name.

Then, you can change the `DEFAULT_LEXICON` environment variable to your
desired lexicon (make sure to use the same capitalization schema). For
example if your gaddag file is named OSPS42.gaddag, the name of the lexicon
is `OSPS42`.
Some other values for letter distribution: `spanish`, `polish`, `german`, `norwegian`, `french`, `catalan`, `polish`. There will be more in the future.

Alternatively, you can just use `set lexicon OSPS42 polish` inside the Macondo shell, for example.
You can find lexicon kwg files at [https://github.com/woogles-io/liwords/blob/master/liwords-ui/public/wasm](https://github.com/woogles-io/liwords/blob/master/liwords-ui/public/wasm)
2 changes: 1 addition & 1 deletion equity/exhaustive_leave.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func defaultForLexicon(lexiconName string) string {
strings.HasPrefix(lexiconName, "NWL") ||
strings.HasPrefix(lexiconName, "NSWL") {

return "NWL20"
return "NWL23"
} else if strings.HasPrefix(lexiconName, "ECWL") || // obsolete name for CEL
strings.HasPrefix(lexiconName, "CEL") { // common english words
return "ECWL"
Expand Down

0 comments on commit 6d48552

Please sign in to comment.