foley.index.taxonomy.ucs#
UCS table loading + the UCS-filename CatID parse (report 04 §5.2, §6.4).
A UCS filename is underscore-delimited with the CatID first:
CatID_FXName_CreatorID_SourceID[_UserCategory_UserData].ext
Only token 0 (the CatID) carries the controlled taxonomy; it is looked up in the
table (never string-split, since the category prefix is variable-length). The
loader merges the in-code seed with an optional full-table JSON drop under
taxonomy/data/ucs_full.json (JSON wins on CatID collision) — open/closed.
Functions
The process-wide default UCS table (seed + any JSON drop), built once. |
|
|
Build the UCS lookup: the seed rows, overridden/extended by a JSON drop. |
|
Return token 0 (the CatID candidate) of a UCS-style filename, else |
|
Parse a UCS-conformant filename to |
- foley.index.taxonomy.ucs.default_ucs_table()[source]#
The process-wide default UCS table (seed + any JSON drop), built once.
- Return type:
- foley.index.taxonomy.ucs.load_ucs_table(*, data_dir=None, include_seed=True)[source]#
Build the UCS lookup: the seed rows, overridden/extended by a JSON drop.
- Parameters:
data_dir – Directory to look for
ucs_full.jsonin (defaults to the package’staxonomy/data/). When present, its rows override the seed on CatID collision and add the rest of the ~750-row master.include_seed (
bool) – Start from the in-code seed table (defaultTrue).
- Return type:
- Returns:
A ready
UcsTable.
- foley.index.taxonomy.ucs.parse_catid_token(filename)[source]#
Return token 0 (the CatID candidate) of a UCS-style filename, else
None.Strips directory and extension; requires at least one
_(the field delimiter). Does not validate the token against the table.