Mentions légales du service

Skip to content
Snippets Groups Projects

Plantinator source

This is the source code for the plantinator app, both the server and the client side.

Installing dependencies

To compile the software, you need OCaml ≥ 4.14.g To compile and run the app, you need to install the following opam packages:

opam install dream cmdliner js_of_ocaml ppx_deriving_yojson js_of_ocaml-ppx js_of_ocaml-lwt base64 dmap

Getting the data

You need to get a copy of the data in a directory called btt-data and btt-corpuses that are at the same level at this directory.

Compiling

Finally, you can run the server with:

dune build
make generate
make server

This opens a webserver on the port 8083. You can then access the app. the editor.

There are quite a few other make command available.

Code organisation

  • core: the common library defining plants, the algorithm and other shared functions between the server, the client, and the command line

  • cli: the command line program that generate the javascript database, and can perform checks and analysis on the corpus of plants. There is also a way to play in the command line (make play)

  • untyxml: part of the web framework

  • web: the javascript client (editor & app)

  • server: the server (only used by the editor)

Usage

Usage of missing and load_csv

To generate the CSV file with the missing values and their associated questions you have to :

  • Make sure you are up to date with
make build
  • Choose a collection and execute the following command
make missing COLLECTION=(your collection)

This outputs missing.csv which contains the questions, and missing values you can open it in LibreOffice or directly into vim or any text editor to fill the values with the following syntax

;value1:weight1 value2:weight2 ... valuen:weightn;

The list of possible values is displayed just after the space dedicated to put your value. Make sure the total weight do not exceed 1, the program do not check for that.

Once you made your modification to the CSV file you can execute the load_csv command to write into the database the modifications

make load_csv COLLECTION=(your collection) CSV=missing.csv

And you're good !