1/* <module> 2% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 3% Both A Bottom Up and Top Down Chart Parser 4% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 5% from the book "Natural Language Processing in Prolog" % 6% published by Addison Wesley % 7% Copyright (c) 1989, Gerald Gazdar & Christopher Mellish. % 8% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 9% Logicmoo Project PrologMUD: A MUD server written in Prolog 10% Maintainer: Douglas Miles 11% Dec 13, 2035 12% 13*/ 14 15:-module(parser_chart89, [chart89/0,test_chart89_regressions/0]). 16 17% :- ensure_loaded(logicmoo(mpred/logicmoo_i_header)). 18% :- baseKB:ensure_loaded(library(bugger)). 19% :- register_module_type(utility). 20 21 22:- style_check(+discontiguous). 23 24:- baseKB:call(op(0,xfx,'/')). 25:- baseKB:call(op(0,fx,'-')). 26:- baseKB:call(op(200,fy,'-')). 27:- baseKB:call(op(500,yfx,'-')). 28:- baseKB:call(op(600,xfy,':')). 29:- baseKB:call(op(400,yfx,'/')). 30 31:- asserta((t_l:enable_src_loop_checking)). 32 33:-multifile(baseKB:type_action_info/3). 34:-multifile(baseKB:agent_call_command/2). 35:-multifile(baseKB:mud_test/2). 36 37% =========================================================== 38% CHART89 command 39% =========================================================== 40baseKBtype_action_info(tHumanControlled,chart89(ftListFn(ftTerm)),"Development test CHART-89 Text for a human. Usage: CHART89 Cant i see the blue backpack?"). 41 42baseKBagent_call_command(_Gent,chart89([])):- chart89. 43baseKBagent_call_command(_Gent,chart89(StringM)):-nonvar(StringM), chart89(StringM). 44 45% its i do that much with my numbers.. i avoid calling is/2 until its needed (i can build up 46 47% =========================================================== 48% CHART89 REPL 49% =========================================================== 50:-thread_local t_l:chart89_interactive/0. 51chart89 :- locally(tracing80, 52 locally(t_l:chart89_interactive, 53 with_no_assertions(t_l:useOnlyExternalDBs, 54 with_no_assertions(lmconf:use_cyc_database, 55 (told, repeat, prompt_read('CHART89> ',U), 56 to_word_list(U,WL),((WL==[bye];WL==[end,'_',of,'_',file];(mmake,once(chart89(WL)),fail)))))))). 57 58:- multifile(t_l:into_form_code/0). 59:- asserta(t_l:into_form_code). 60 61% :- ensure_loaded(logicmoo(parsing/chart89/dcgtrans)). % generator 62% :- retract(t_l:into_form_code). 63 64:- include(chart89/buchart2). % toplevel 65 66%:-export(test_chart89_regressions/0). 67test_chart89_regressions:- time((test1,test2)). 68:- retract(t_l:into_form_code). 69 70:- retractall(t_l:enable_src_loop_checking). 71 72 73baseKBmud_test(chart89_regressions,test_chart89_regressions). 74 75% :- context_module(CM),module_predicates_are_exported(CM). 76% :- context_module(CM),quiet_all_module_predicates_are_transparent(CM). 77% :- context_module(CM),module_property(CM, exports(List)),moo_hide_show_childs(List). 78 79% :- ensure_loaded(logicmoo('vworld/moo_footer.pl')).