Skip to content

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

Open
@kueblc

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions