Giter Site home page Giter Site logo

ecolect-js's Introduction

πŸ‘‹ Hi, I'm Andreas Holstenson

I work with user-centered problem solving using technology. You'll find me in MalmΓΆ, Sweden.

I enjoy building things and over the years on GitHub I've pushed 6614 commits, opened 45 issues and submitted 47 PRs. There's currently 25 repositories around here with 2038 stars.

Want to get in touch? Send me an e-mail at [email protected] or connect with me on LinkedIn.

ecolect-js's People

Contributors

aholstenson avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ecolect-js's Issues

ecolect/values/ordinal is missing

const ordinal = require('ecolect/values/ordinal');

Error: Cannot find module 'ecolect/values/ordinal'

The parser exists under the language but is missing in values

CJS directory missing?

It seems that files were moved to /cjs directory, however this directory was never uploaded.
Is this intentional?

Can i change language ? ( simple way )

i tried to change the language to french, copy and past all the config en in another folder but it crash everytime.

Like if the new language can't be in another place then ecolect folder but i need it for my work every time i have the same error :
[node-red-contrib-ecolect/ecolect] SyntaxError: Unexpected token {

Some values match but are not included in result when using any

Consider the following examples

// ecolect 0.6.0
const ecolect = require('ecolect')
const en = require('ecolect/language/en')
const { any, dateTime } = require('ecolect/values')

const intents = ecolect.intentsBuilder(en)
	.intent('schedule:when')
		.value('when', dateTime())
		.value('remainder', any())
		.add('{when} {remainder}')
		.add('{remainder} {when}')
		.done()
	.build()

// "1s test" matches but only contains "remainder"
// "test 1s" matches with both "remainder" and "when"
// ecolect 0.7.0-beta.6
const { newPhrases, timeValue, anyTextValue } = require('ecolect')
const { en } = require('ecolect/language/en')

const matcher = newPhrases()
	.value('when', timeValue())
	.value('remainder', anyTextValue())
	.phrase('{when} {remainder}')
	.phrase('{remainder} {when}')
	.toMatcher(en)

// same as in 0.6.0
// "1s test" matches but only contains "remainder"
// "test 1s" matches with both "remainder" and "when"

Not just dateTime but number, enumeration, and possibly others seem to be effected when followed by an any value.

Skipable tokens

Currently 'in', 'at', 'for', 'a', 'an' are hard coded as skipable tokens. In my use of Ecolect I've found that it would be good to have a few more skipable tokens such as 'the' and 'by'.

Possibly this should be made a configuration item, either by intent or globally.

Dean

ecolect/values/time is missing

const ordinal = require('ecolect/values/time');

Error: Cannot find module 'ecolect/values/time'

The parser exists under the language but is missing in values

`Error: Multiple matches are only supported when in partial mode` when `any` matches input containing skipword

Consider this simplified example

// ecolect 0.6.0
const ecolect = require('ecolect')
const en = require('ecolect/language/en')
const { any } = require('ecolect/values')

const intents = ecolect.intentsBuilder(en)
	.intent('catchall')
		.value('any', any())
		.add('{any}')
		.done()
	.build()

// "test a" works fine ("any" == "test")
// "a test" works fine ("any" == "test")
// "test a test" results in `Error: Multiple matches are only supported when in partial mode`
// "test a a" also results in error
// "a a a" also results in error

Additionally, in some situations it seems that after triggering this error, it will break future matching for any expression, including ones that worked previously. I haven't been able to narrow this down yet.

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.