Skip to content

Commit 6b0db17

Browse files
committed
improved managing of forced person for issue #7
1 parent 11f670f commit 6b0db17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/handlers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function handleVERB(obj, sentence, langRef, src, defaults, forces){
3030
obj.meta.PERSON = defaults.PERSON;
3131

3232
const childrenSUBJ = obj.children.filter(c => c.type === 'SUBJ' || c.type === 'NOUN') //HERE: check if include NOUN here is ok
33-
if (forces.PERSON){
33+
if (forces.PERSON && childrenSUBJ.every(c => !sentence[c.position].words.includes(forces.PERSON))){
3434
obj.meta.PERSON = forces.PERSON;
3535
} else if (childrenSUBJ.length > 1) {
3636
const childrenSUBJpersons = childrenSUBJ.map(c => sentence[c.position].meta.PERSON)

0 commit comments

Comments
 (0)