-
Notifications
You must be signed in to change notification settings - Fork 2
datrie
The beta.py program depends on a package datrie, see Python Package Index (PyPI). The package datrie implements so called tries or letter trees (trie) very efficiently which is essential in the Beta algorithm. Thanks to it, beta.py can handle grammars with thousands of rules in an efficient manner.
On all systems, the package datrie can be loaded for global use (if you have the priviliges) by using a command (which is the recommended way):
$ python3 -m pip install datrie
which works for Python 3.4 or later. An alternative way is (again if you have sufficient privileges, and if pip3 is already installed on your system):
$ pip3 install datrie
If pip3 is not installed on your system, you must first install it by some means specific to your system.
On Windows systems, the attempt to install datrie may complain that you need "visual-cpp-build-tools" package in order to install datrie. Such a package is available from the net. Just load the installer file and run the installer, and repeat the installation of datrie as above.
On Mac OS X you probably need the "Xcode" package in order to install datrie. Xcode is freely available from the AppStore.
In Linux systems, all packages needed for the installation of datrie are usually already a part of the system.
If you are using a server for which you have only normal user privileges, you might use the following command in order to install datrie in your home directory:
$ python3 -m pip install --install-option="--prefix=$HOME/.local" datrie
You can use such a local installation just as easily as a global installation. The only difference is that other users on the same computer must install their own copies.
Note: Version 0.7.1 of datrie has been tested to work with beta.py. If you want to install that specific version, you may do it by:
$ pip3 install datrie==0.7.1
If you have installed a later version and meet problems such as obscure messages relating to memory allocation, you may replace the later version by the above version by:
$ pip install --force-reinstall datrie==0.7.1