ng_word Table
Overview
| Item | Details |
|---|---|
| Table name | ng_word |
| Description | Prohibited words checked against generated text. The article/blog generation and rewrite Lambdas load every row at start-up, build an Aho-Corasick automaton, and scan their output with it |
| Primary use | Managing prohibited words and screening generated output |
Column Definitions
| Column | Type | PK | FK | Unique | Nullable | Default | Notes |
|---|---|---|---|---|---|---|---|
| _id | ObjectId | โฏ | โฏ | Auto-generated by DocumentDB | |||
| name | string | The prohibited word | |||||
| created_at | number | ||||||
| updated_at | number | ||||||
| deleted_at | number | โฏ |
Screening behaviour
- Screening lives in
packages/ng_word_filter. Some words are excluded from the check to avoid false positives (seefilter.pyin that package) - When a prohibited word is found, the detected words are fed back and the text is regenerated (up to twice). If it still cannot be resolved, generation fails and the article/blog is not published
- On rewriting (blog_rewriter), words already present in the source past blog are excluded. A rewrite preserves the original content, so words that came from the source (e.g. a jockey's name) can never be removed by regenerating