Skip to content

No OOV validation before starting a game — all guesses return "not in vocabulary" #68

@FlorentPoinsaut

Description

@FlorentPoinsaut

Description

When the target word chosen by random.choice() is not in the frWac vocabulary, every guess from every player returns:

'word' is not in the vocabulary.

There is no indication that the game itself is broken. The session is unplayable but players have no way of knowing why.

Location

# bot/bot.py
target = random.choice(words)
self._game_state.start_new_game(target, diff)

No vocabulary check is performed before launching the round.

Proposed fix

Filter the word list to vocabulary members before selecting a target:

in_vocab = [w for w in words if engine.score_guess(w, w) is not None]
if not in_vocab:
    await ctx.send("No playable words found for this difficulty. Check the word list.")
    return
target = random.choice(in_vocab)

Or add an is_in_vocab(word: str) -> bool helper on the engine for clarity.

Impact

  • Silent broken games — unplayable with no feedback
  • Affects both EASY and HARD/MEDIUM difficulties depending on which words in the list are OOV
  • Risk is higher for interest_words_d.txt which contains rare/literary words (see related issue)

Files

  • bot/bot.py — game start logic
  • game/engine.py — add is_in_vocab() helper

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical blocker — must fix immediatelybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions