Don't add an implicit 'to' after 'wanna' when a noun follows

This commit is contained in:
dualfroz committed 2026-10-03 01:05:43 +02:00
1 parent 2f6cf3b20d
commit fd61e5bc5a
3 files changed
+45

No files matched your search

+16
View File
@@ -33,6 +33,22 @@ test('basic is contractions', function (t) {
t.end()
})
test('wanna before a noun', function (t) {
const arr = [
['I wanna pickle', 'I want pickle'],
['I wanna a cookie', 'I want a cookie'],
['do you wanna coffee?', 'do you want coffee?'],
['I wanna go', 'I want to go'],
['I wanna pickle some beets', 'I want to pickle some beets'],
]
arr.forEach(([str, want]) => {
const r = nlp(str)
r.contractions().expand()
t.equal(r.text(), want, here + str)
})
t.end()
})
test('do-not contractions', function (t) {
let r = nlp(`please do not eat the marshmellow`)
r.contractions().expand()