Skip to content

CodingAndCodingAgain/secret-code-cheat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Secret Code Cheater

A mobile app that helps you find related "secret code" words for the Spanish word game. Enter Spanish words, and the app groups them by semantic similarity and suggests related words using FastText embeddings, WordNet hypernyms, and ConceptNet cultural relations.

How It Works

  1. Enter one or more Spanish words into the app
  2. The app groups your words by semantic similarity (cosine similarity on FastText embeddings)
  3. For each group, it finds the top related words from a 50K-word Spanish vocabulary
  4. If the suggestions aren't helpful, tap "Not convinced" to see more

Behind the scenes, the app uses:

  • FastText embeddings (300-dimensional, we use half of them) for semantic similarity
  • WordNet hypernyms to find words that share a common category
  • ConceptNet cultural relations to capture associations beyond pure word-vector similarity

Project Structure

secret-code-cheat/
├── asset-parser/       # Python pipeline that generates app assets
│   ├── get_words.py                    # Downloads Spanish word list (top 50K)
│   ├── generate_embeddings.py          # Generates FastText embedding chunks
│   ├── generate_hypernyms.py           # Generates WordNet hypernym mappings
│   ├── generate_cultural_relations.py  # Generates ConceptNet relation map
│   └── generate_all.py                # Runs the full pipeline
└── expo-app/           # React Native (Expo) mobile app
    ├── App.tsx                         # Main UI
    └── src/
        ├── embeddings.ts               # Loads and caches embeddings
        ├── hypernyms.ts                # Loads and caches hypernyms
        ├── culturalRelations.ts        # Loads and caches cultural relations
        └── search.ts                   # Similarity search and word grouping

Prerequisites

  • Python 3.10+ (for the asset pipeline)
  • Node.js 18+ and npm (for the Expo app)
  • Expo CLI (npx expo)
  • An Android emulator or physical device with Expo Go

Setup

1. Generate Assets

The app requires pre-generated embedding and language data files. Run the asset pipeline first:

cd asset-parser
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt

Then run each step of the pipeline:

python get_words.py                    # Download + extract top 50K Spanish words
python generate_embeddings.py          # Generate embeddings (downloads ~4GB FastText model on first run)
python generate_hypernyms.py           # Generate hypernym mappings via NLTK WordNet
python generate_cultural_relations.py  # Download ConceptNet + generate cultural relations

Or run everything at once:

python generate_all.py

The generated .ejson files are automatically copied into expo-app/assets/.

2. Run the App

cd expo-app
npm install
npx expo start

Then press:

  • a to open on Android emulator
  • w to open in a web browser
  • Scan the QR code with Expo Go on a physical device

Notes

  • The FastText model (cc.es.300.bin) is ~4 GB and downloaded automatically on the first run of generate_embeddings.py. It is gitignored.
  • All generated asset files (.ejson) are gitignored. You must run the asset pipeline before the app will work.
  • The embeddings are split into chunks (max 100 MB each). With 50K words this produces 2 chunks.

About

An app for cheating in the spanish version of the game Codenames ("Codigo Secreto"), the board game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors