<commit_before>;Check if a query is truth query or wh-query 
;--------------------------------------------------------------------------------------------
(define (check_query_type querySentence)
(cog-name 
	(car (cog-chase-link 'InheritanceLink 'ConceptNode 
		(car (cog-chase-link 'InterpretationLink 'InterpretationNode 
			(car (cog-chase-link 'ParseLink 'ParseNode querySentence				
			))
		))
	))
))
;---------------------------------------------------------------------------------------------
;Accept user's query and user's id as an input
;call "check_query_type" function to check if the query is  'wh' or 'yes-or-no' question
;if query is yes-or-no call 'truth_query_process' else call 'wh_query_process'
;----------------------------------------------------------------------------------------------
(define (process_query user query)
        (define querySentence)
        (set! querySentence (car (nlp-parse query)))
        (display "Hello ")
        (display user)
        (display ", you said: \"")
        (display query)
        (newline)
        (cond
                ((equal? (check_query_type querySentence) "TruthQuerySpeechAct")(display "You ask a Truth Query ")
                ;;(truth_query_process querySentence)
                (display "I can't process truth query for now"))
                ((equal? (check_query_type querySentence) "InterrogativeSpeechAct")(display "You ask an InterrogativeSpeechAct")
                (wh_query_process querySentence))
                (else (display "you made a statement"))
        )
)
;----------------------------------------------------------------------------------------------
;Use backward chaning to process 'yes-or-no' question
;depending on the backward chaning generate the answer (using SuRel)
;----------------------------------------------------------------------------------------------
(define (truth_query_process query)
        (define tmp)
        (define bc)
        (set! tmp (fAtom query))
        (set! bc (cog-bc (cog-new-link 'InheritanceLink (VariableNode "$x")(gdr tmp))))
)
;----------------------------------------------------------------------------------------------
; process wh-question using the fuzzy hyper graph Matcher
;----------------------------------------------------------------------------------------------
(define (wh_query_process query)
    (get-similar-sentences query)
)

;---------------------------------------------------------------------------------------------
; Used by 'truth_query_process' to find the input for the backward chaining<commit_msg>some fix<commit_after>;Check if a query is truth query or wh-query 
;--------------------------------------------------------------------------------------------
(define (check_query_type querySentence)
(cog-name 
	(car (cog-chase-link 'InheritanceLink 'ConceptNode 
		(car (cog-chase-link 'InterpretationLink 'InterpretationNode 
			(car (cog-chase-link 'ParseLink 'ParseNode querySentence				
			))
		))
	))
))
;---------------------------------------------------------------------------------------------
;Accept user's query and user's id as an input
;call "check_query_type" function to check if the query is  'wh' or 'yes-or-no' question
;if query is yes-or-no call 'truth_query_process' else call 'wh_query_process'
;----------------------------------------------------------------------------------------------
(define (process_query user query)
        (define querySentence)
        (set! querySentence (car (nlp-parse query)))
        (display "Hello ")
        (display user)
        (display ", you said: \"")
        (display query)
        (newline)
        (cond
                ((equal? (check_query_type querySentence) "TruthQuerySpeechAct")(display "You ask a Truth Query ")
                ;;(truth_query_process querySentence)
                (display "I can't process truth query for now"))
                ((equal? (check_query_type querySentence) "InterrogativeSpeechAct")(display "You ask an InterrogativeSpeechAct")
                (wh_query_process query))
                (else (display "you made a statement"))
        )
)
;----------------------------------------------------------------------------------------------
;Use backward chaning to process 'yes-or-no' question
;depending on the backward chaning generate the answer (using SuRel)
;----------------------------------------------------------------------------------------------
(define (truth_query_process query)
        (define tmp)
        (define bc)
        (set! tmp (fAtom query))
        (set! bc (cog-bc (cog-new-link 'InheritanceLink (VariableNode "$x")(gdr tmp))))
)
;----------------------------------------------------------------------------------------------
; process wh-question using the fuzzy hyper graph Matcher
;----------------------------------------------------------------------------------------------
(define (wh_query_process query)
    (get-similar-sentences query)
)

;---------------------------------------------------------------------------------------------
; Used by 'truth_query_process' to find the input for the backward chaining
{'fraction_non_alphanumeric': 0.36668617125024383, 'fraction_numerical': 0.0, 'mean_word_length': 1.151006711409396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '965615', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1139, 'n_words': 348}