Update: english_parser.py: Capture the case where the subject is doing an activity about itself rather than affecting an object, like in >sebastian is jogging in the park< where the predicate becomes a property of performing an activity
@@ -143,9 +143,14 @@ while True:
predicate = lastpredicate
lastsubject = subject_modifiers.replace("_subject_", subject)
lastpredicate = predicate_modifiers.replace("_predicate_", predicate)
+ if subject != "" and predicate !="" and object == "":
+ object = subject
if subject != "" and predicate != "" and object != "": #output Narsese relation if all pieces are together, with a special case for be/Inheritance
if lastpredicate == "be":
output(("<" + subject_modifiers + " --> " + object_modifiers + ">" + punctuation + " :|:").replace("_subject_", subject).replace("_object_", object))
+ else:
+ if object == subject:
+ output(("<" + subject_modifiers + " --> [" + predicate_modifiers + "]>" + punctuation + " :|:").replace("_subject_", subject).replace("_predicate_", predicate))
else:
output(("<" + subject_modifiers + " --> (" + predicate_modifiers + " /1 " + object_modifiers + ")>" + punctuation + " :|:").replace("_subject_", subject).replace("_predicate_", predicate).replace("_object_", object))
if isWordType(word, 'ADP'): #identify prepositions in which case we keep the assignments
