Upstream spencermountain/compromise state of the touched files before c7e26e9613
This commit is contained in:
1 parent
e808a140a8
commit
064b048c83
2 files changed
+277
No files matched your search
@@ -0,0 +1,18 @@
|
||||
const keep = { tags: true }
|
||||
|
||||
const nounToSingular = function (m, parsed) {
|
||||
// already singular?
|
||||
if (parsed.isPlural === false) {
|
||||
return m
|
||||
}
|
||||
const { methods, model } = m.world
|
||||
const { toSingular } = methods.two.transform.noun
|
||||
// inflect the root noun
|
||||
const str = parsed.root.text('normal')
|
||||
const single = toSingular(str, model)
|
||||
m.replace(parsed.root, single, keep).tag('Singular', 'toPlural')
|
||||
// should we change the determiner/article?
|
||||
// m.debug()
|
||||
return m
|
||||
}
|
||||
export default nounToSingular
|
||||
Reference in new issue
Block a user