lojban / jbofihe

Parser & analyser for Lojban
GNU General Public License v2.0
33 stars 2 forks source link

################################################################################ $Header$ ################################################################################

The new home of jbofihe is https://github.com/lojban/jbofihe/ . For support, use the issues page there, or try the main Lojban mailing list.

================ WHAT IS JBOFIHE?

jbofihe is a command-line driven program with the following functions :

Bundled with jbofihe are 4 other programs :

========= COMPILING

If you have podman, just run: ./build.sh

(It should also work with docker, but will require some tweaking.)

This is also how the releases are built.

Otherwise:

The build sequence looks like this (assuming you want to install under /usr/local)

perl config.pl --prefix=/usr/local make all make install

(optionally: DESTDIR=/tmp/foo make install ; installs in /tmp/foo but without changing the prefix, so that programs can still find what they're looking for; useful for packaging)

The config.pl script takes these additional (optional) arguments : --debug to compile with debug instead of optimisation --installprog= to specify an alternative installation program. --nommap to use fread() rather than mmap() to access the dictionary (use this on non-Posix systems) --embded to build a minimal (gismu+cmavo) dictionary into the executable (rather than requiring a dictionary database separately at runtime)

There are some pre-requisites for compiling. You need the following tools/libraries installed to have a hope of building the software :

It should be possible to compile and run the software on Unix and on Win32 systems (cygwin). For reference, the software was developed on Linux on a 486/120 with 32Mb of RAM. As of version 0.35, I have ported the software to MS-DOS, using the DJGCC compiler. The DOS version should run in Windows DOS boxes too. It requires some form of DPMI server; one is bundled for use on bare MS-DOS systems.

The following tools are recommended but not essential to support some of the output formats:

As from version 0.35, minimal word-lists (gismu and cmavo) are bundled with the source. You can download lujvo lists separately from ftp://xiron.pc.helsinki.fi/pub/lojban/wordlists. If either (or both) of the files lujvo-list and/or NORALUJV.txt is found at build time, it/they will be included into the glossing dictionary that jbofihe and cmafihe use. Otherwise, only gismu & cmavo will be included. (Any lujvo will then be glossed by breaking it into individual rafsi and glossing those.)

The file sizes in bytes of the versions I'm using are as follows

808959 NORALUJV.txt 292281 lujvo-list

and their md5 checksums are

d750de398740a2ba701422a466ddbeab NORALUJV.txt dbd82f42f4156a2a1801e2a5ec1e551e lujvo-list

========= PACKAGING

Just run ./build.sh ; if that doesn't work on your system, fix that and make PR please (but don't drop podman support; if you need to run docker instead, modify the script to work with either).

======= RUNNING

If your compiled dictionary is not in the default location (i.e. you are not installing properly or want to use a private local dictionary), set the JBOFIHE_DICTIONARY environment variable to where you have installed smujmaji.dat

The command line is documented in the manual pages. Some brief examples follow :

Suppose your Lojban text is in the file sample.txt, containing

mi klama le zarci

jbofihe -x -b sample.txt gives : [ ( mi ) << klama >> ( le
[ ( I, me ) [is, does] << go-ing >> ( the
[ ( klama1 (go-er(s)) ) << >> ( klama2 (destination(s)) 1 2 2 3 3 4

zarci            ) ] 
trading place(s) ) ] 
                 ) ] 
                 4 1 

jbofihe -k sample.txt gives : Token list before preprocessing

CMV : mi [me]
BRV : klama
CMV : le [the described]
BRV : zarci

------------------------------
Token list after preprocessing

CMV : mi [me]
BRV : klama
CMV : le [the described]
BRV : zarci

(0[mi {klama <le zarci>}])0

jbofihe -t sample.txt gives : | +-CMAVO : mi | | +-BRIVLA : klama | | | +-CMAVO : le | | | +-BRIVLA : zarci | | +-SUMTI_6 | +-BRIDI_TAIL_3 +-NO_CU_SENTENCE CHUNKS

cmafihe sample.txt gives : mi [I, me] klama [come] le [the] zarci [market]

cmafihe -b sample.txt gives : mi klama le zarci
KOhA3 BRIVLA LE BRIVLA I, me come the market

'jvocuhadju gerku zdani' gives : Possible rafsi for input words : ger ge'u zda

 Score  Lujvo
--------------------
  5878 gerzda
  6367 ge'uzda