MycroftAI / adapt

Adapt Intent Parser
Apache License 2.0
711 stars 155 forks source link

Change [] to () #92

Closed ChristopherRogers1991 closed 5 years ago

ChristopherRogers1991 commented 5 years ago

Fixes https://github.com/MycroftAI/adapt/issues/91

ChristopherRogers1991 commented 5 years ago

Apologies for the delay - I've added a simple unit test for test_resolve_one_of, which should fail on master but pass on this branch, and I've changed .get to [].

clusterfudge commented 5 years ago

Sorry, it's going to take me a while to grok this test (need to revisit what are the inputs and outputs of this method). I think the more practical test is one that makes use of the "at least one" semantics of an intent definition, as opposed to asserting on the outputs of this deep-in-the-bowels method.

ChristopherRogers1991 commented 5 years ago

@clusterfudge, I've added another test that should hopefully be more straightforward. The key is that a tag (temperature' in the test) needs to be possible in multiple locations (passed in to multipleone_ofcalls), so that we have to advance to the second possible tag (updatelast_end_index`) in one of those locations.

ChristopherRogers1991 commented 5 years ago

Hey @clusterfudge,

Friendly ping. Let me know if you'd like me to make any other changes.

-Christopher

clusterfudge commented 5 years ago

Cool, last request, please update the version in setup.py to 0.3.3

ChristopherRogers1991 commented 5 years ago

@clusterfudge, done. The version is now 0.3.3.

clusterfudge commented 5 years ago

image