Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Examples

This directory contains example codes that generate a paraphrase lattice and search a phrase in the generated lattice.

All bindings require cargo and rustc for building the parattice library. Install the latest Rust refering this documentation. To convert the generated lattice to an image file, install Graphviz beforehand:

Debian/Ubuntu:

sudo apt install graphviz

Mac OS X (Homebrew)

brew install graphviz

Rust

Just run cargo run in rust directory.

To convert the generated lattice to an image file, run dot -Tpng -O ./paraphrase-lattice.dot.

C++

  1. Install cmake as follows:

    Debian/Ubuntu:

    sudo apt install cmake

    Mac OS X (Homebrew):

    brew install cmake
  2. Run cargo build --release in the top derectory of this repository to build parattice library.

  3. Run cmake . && make in cpp directory to build the example code.

  4. Run ./parattice_example.

  5. To convert the generated lattice to an image file, run dot -Tpng -O ./paraphrase-lattice.dot.

Clojure

  1. Install Leiningen refering this documentation.

  2. Install gradle as follows:

    Debian/Ubuntu:

    sudo apt install gradle

    Mac OS X (Homebrew):

    brew install gradle
  3. Run cargo build --release in the top derectory of this repository to build parattice library.

  4. Run the following commands in the top directory of this repository to build and to install JAR files of parattice:

    gradle -b bindings/jni/build.gradle build
    gradle -b bindings/jni/build.gradle publishToMavenLocal
  5. If you use Mac OS X, please edit project.clj as follows:

    [parattice "0.2.2-SNAPSHOT" :classifier "linux-amd64"]

    ↓↓↓

    [parattice "0.2.2-SNAPSHOT" :classifier "darwin-amd64"]
  6. Run lein run in clojure directory.

  7. To convert the generated lattice to an image file, run dot -Tpng -O ./paraphrase-lattice.dot.

Example graph