rulify
v1.0.0
Published
Converts .rule files into .fst files for consumption by NLU parser.
Downloads
5
Keywords
Readme
Rulify
Convert .rule files into .fst files.
Node Usage
Rulify takes two arguments, the first is the path to the RULE file, the second is the callback when complete.
const rulify = require('rulify');
rulify('main.rule', function(err, output) {
// output is the path to the output file
});
Specify Output
An optional second argument can be the output path for the FST file.
rulify('src/main.rule', 'rules/main.fst', function(err, output) {
// file is saved
});
Sync
There's an option to run rulify synchronously.
rulify.sync('src/main.rule', 'rules/main.fst');
Commandline
Installing rulify globally (npm install -g rulify
) will allow you to batch convert rule files to fst files.
Convert to FST
Convert a single file. Must specify the output directory (either -o
or --output
).
rulify -o rules src/main.rule
Multiple files
Use the -o
or --output
argument to specify an output directory.
rulify --output rules src/*.rule
rulify -o rules src/*.rule
Convert Directory
Use the -i
or --input
argument to specify an input directory of files.
rulify --output rules --input src
rulify -o rules -i src