Data structure
After loading and parsing the spreadsheet, keywords are stored in thepalabrasClaveOriginal array:
| Field | Type | Description |
|---|---|---|
palabra | string | The keyword or phrase to match against news text |
padre | string | The category (or categories) this keyword belongs to. Use semicolons for multiple categories: Salud;Destacadas |
How categories are built
The categories list is derived entirely from thepadre values in the keywords array — there is no separate categories table. The application splits multi-category values on semicolons, trims whitespace, removes empty strings, deduplicates, and sorts alphabetically:
importar.component.ts
padre value in the spreadsheet — no code changes are required.
How keyword matching works
During categorization, each news item’s body text is checked against every keyword using a case-insensitive full-text search. Both the keyword and the news text are lowercased before comparison, but diacritics (accents) are not normalized — the match is an exact substring search on the lowercased strings. This meanscórdoba and cordoba are treated as different strings.
The “General” fallback category
If no keyword matches a news item, the item is assigned to the General category. This ensures every item is classified and visible to operators — nothing is silently dropped.Monitor the General category regularly. A high volume of items landing there may indicate that important keywords are missing from the spreadsheet.
The “Destacadas” special category
Destacadas is a reserved category name that triggers special handling. When a news item is assigned to Destacadas (either as its sole category or as one of multiple categories), the item’s destacada flag is set to true.
Featured items appear prominently in the operator’s curation view and are typically included at the top of dispatched digests.
To mark a keyword as always-featured, add Destacadas as one of its parent categories in column B of the spreadsheet:
Google Spreadsheet — Column B
Multi-category assignment
A single keyword can belong to more than one category. Separate category names with a semicolon in column B, with no spaces around the semicolon:| Column A (keyword) | Column B (categories) |
|---|---|
intendente | Política |
vacuna | Salud;Destacadas |
tránsito | Tránsito;Movilidad |
obra vial | Infraestructura;Tránsito |
Adding a new keyword
Open the master spreadsheet
Open the Google Spreadsheet configured in
shared.service.ts. See Google Sheets integration for the spreadsheet ID and access instructions.Add a new row
Scroll to the first empty row below the existing keywords. Do not insert rows above the header row (row 1).
Enter the keyword in column A
Type the word or phrase exactly as it should appear in news text, including any accent marks. Accent normalization is not applied — the keyword must match the actual form used in press clipping messages.
Enter the category in column B
Type the category name. To assign multiple categories, separate them with a semicolon:The category name must match exactly (case-sensitive) the names used by other keywords to ensure the categories list is consistent.
Save the spreadsheet
Google Sheets saves automatically. No manual publish step is needed unless you are using File → Publish to web.
Removing or modifying a keyword
To remove a keyword, delete its row from the spreadsheet. To change the category assignment, edit column B in place. Changes take effect on the next import.Best practices
- Test new keywords against real log samples before relying on them in production. Paste recent press clipping text into a search tool to confirm the phrase appears as expected.
- Avoid single-character or very common words as keywords. They will match almost every item and produce noisy category assignments.
- Use the
Destacadascategory sparingly. If too many keywords are flagged as featured, the distinction loses meaning for operators. - Standardize category names. Because categories are derived dynamically from
padrevalues, a typo likeSalúdinstead ofSaludcreates a duplicate category. Maintain a reference list of approved category names. - Review the General category weekly. Items that fall through to General often indicate coverage topics that have not yet been mapped to keywords.