Open
Description
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.
Activity