Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Build 1-gram / 2-gram / 3-gram tables

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

No source files or tests are named. Start by locating how training data enters the Python project, then use the stated table format and verify the serialization, memory-footprint documentation, and lookup-time benchmark against the success criteria.

Written by the indexing model from the issue text.

Description

data model

Summary

Build n-gram frequency tables from the training data for lookup-based generation.

Success Criteria

  • 1-gram table: token → count
  • 2-gram table: (token₁) → [(token₂, count), ...]
  • 3-gram table: (token₁, token₂) → [(token₃, count), ...]
  • Tables serialized efficiently (consider trie structure)
  • Memory footprint documented
  • Lookup time benchmarked (<1μs per lookup target)

Implementation Notes

  • Consider smoothing for unseen n-grams
  • Store both raw counts and probabilities
  • Prune low-frequency entries to control size

Table Format

```python
{
"unigram": {"feat": 15000, "fix": 12000, ...},
"bigram": {"feat": {"add": 5000, "implement": 3000, ...}, ...},
"trigram": {("feat", "add"): {"new": 2000, "support": 1500, ...}, ...}
}
```

Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aRustyDev/ccgram

All issues in aRustyDev/ccgram

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.