Lua APIΒΆ

Chinese Text Analyser exposes a module cta that you can include in your own Lua scripts to gain access to features and functionality such as text segmentation and processing, statistics, word lists and dictionaries.

The cta module includes the following functions:

In addition, Chinese Text Analyser also comes with the lfs module and the lua-csv module to provide support for accessing the file system and for reading and writing comma (and tab) separated files.

These can be included in your scripts as follows:

1
2
local lfs = require 'lfs'
local csv = require 'csv'

And then you can use the lfs and csv variables to access the functionality of these modules.