inl

iot-native-lang

robots can hear us

Showing:

Popularity

Downloads/wk

20

GitHub Stars

0

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

2

Size (min+gzip)

83.2KB

License

Apache-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

iot-native-lang

robots can hear us

What is it

Simple module which try to convert native language text into commands. For example, we could say 'turn off the lights' and your power switch can handle it.

How to Use

'use strict';
Lang = require('iot-native-lang');

var lamp = new Lang({
  // default, other available are: 'ru', 'es', 'fa', 'fr', 'it', 'nl', 'no', 'pl', 'pt'
  lang: 'en'
  // order is important: first items will be parsed earlier
  // (at least using object iteration order - this is not reliable way, need to change in further)
  listen: {
    'kitchen': {
      'light lamps': {
        'enable': 'on',
        'set increase decrease low high': 'dim',
        'disable default': 'off'
      }
    }
  }
});

var result = lamp.hear('dear lamp on the kitchen, can you enable yourself? plzkthz');
// result.found: 'on'
// result.left: tokens which was'nt parsen on route from 'kitchen' to 'on'
// result.total: all tokens

var result = lamp.hear('kitchen, set light to 200');
// result.command: 'dim', you can parse 200 from 'result.left' (take a look into example)

var result = lamp.hear('hey you, turn on lamp');
// din't find 'kitchen', so result.command will be null

License

Copyright (c) 2015. Licensed under the Apache 2.0 license.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial