Giter Site home page Giter Site logo

machinebox's Introduction

Build Status

Machinebox Client

machinebox is a Rust client for the machinebox.io suite of machines. It provides a simple means of accessing the machines, exposing common functionality to all machines as well as box-specific functionality. Each "box" or "box type" is separated into its own module and struct.

Modules

The following is a list of the modules corresponding to machinebox types and which ones have been implemented so far:

  • Textbox
  • Facebox
  • Tagbox
  • Videobox
  • Nudebox
  • Suggestionbox
  • Fakebox

Usage

To use features, simply call the appropriate function on the corresponding box:

extern crate machinebox;

use machinebox::textbox::Textbox;
use machinebox::BoxClient;

// Make sure you actually have a textbox running here...
let tb = Textbox::new("http://localhost:8080");

let analysis = tb.check("Pay William $200 tomorrow");
    if let Ok(res) = analysis {
        let money = res.sentences[0].entities.iter().find(|e| e.entity_type == "money");
        match money {
            Some(val) => println!("You specified {}", val.text),
            None => println!("You didn't indicate money"),
        }
    }

The above code will analyse the phrase Pay William $200 tomorrow, flagging tomorrow as a date and 200 as an entity of type money.

Notes

If you run the tests locally, you'll need RUST_TEST_THREADS=1 because the mock HTTP server persists throughout the lifetime of the test run.

machinebox's People

Contributors

autodidaddict avatar

Watchers

Mat Ryer avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.