Configuration

Config

class botok.Config(dialect_name=None, base_path=None)[source]

botok config for Tibetan dialect pack.

Each dialect pack has two components:
  1. Dictionary: - contains all the data required to construct the Trie. - It should in the directory called dictionary inside the dialect pack directory.

  2. Adjustment: - Contains all the data required to adjust the text segmentation rules.

add_dialect_pack(path)[source]

“Merge given dialect_pack at path to current dialect_pack.

classmethod from_path(dialect_pack_path)[source]

Creates config from dialect_pack_path.

Returns

class: Config: An instance of a Configuration object

Examples:

config = Config.from_path(path_to_dialect_pack)
assert config.dictionary == True
assert config.adjustments == True
property profile

Returns profile name of the dialect_pack.

reset(dialect_pack_path=None)[source]

Reset the config to default bo_general_pack.