Skip to content

lojban/jbofihe

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
rtg
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
################################################################################
$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 :

- checking grammatical correctness of Lojban text
- displaying successfully analysed text with nesting of grammatical constructs
  shown (either inline or as a tree)
- displaying approximate word-for-word English translations of the Lojban
  words, with some limited 'part-of-speech' adjustment of the English forms.
- showing which sumti fill each of the places of each selbri

Bundled with jbofihe are 4 other programs :

- cmafihe is a cut-down jbofihe which has no grammar checking (so it's
  particularly useful for getting an initial word look-up on badly formed
  texts)
- smujajgau builds the pre-sorted binary format Lojban->English word database
  that jbofihe and cmafihe use
- jvocuhadju determines the optimal lujvo for a given tanru input to it as
  command line arguments.
- vlatai analyses a Lojban word for syntactic correctness, determines the type
  of word (gismu, cmene, lujvo, fu'ivla etc), and reports whether there are any
  cmavo prefixed to it.  (It is the really the testbench for part of jbofihe,
  but it is sufficiently useful that it is bundled as a program in its own
  right.)

=========
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=<name> 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 :

- bison (yacc probably OK, edit the makefile)
- flex (lex probably OK, ditto)
- an ANSI C compiler (gcc recommended)
- perl
- make (GNU make recommended)

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:
- LaTeX (to format the highest quality outputs from the s/w)
- a web browser (to display the intermediate quality output)

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 <KOhA3> [I, me] klama <BRIVLA> [come] le <LE> [the] zarci <BRIVLA> [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