Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. session('Rules; Semantic Technology; and Cross-Industry Standards',
  2. ['XBRL - Extensible Business Reporting Language',
  3. 'MISMO - Mortgage Industry Standards Maintenance Org',
  4. 'FIXatdl - FIX Algorithmic Trading Definition Language',
  5. 'FpML - Financial products Markup Language',
  6. 'HL7 - Health Level 7',
  7. 'Acord - Association for Cooperative Operations Research and Development (Insurance Industry)',
  8. 'Rules for Governance; Risk; and Compliance (GRC); eg; rules for internal audit; SOX compliance; enterprise risk management (ERM); operational risk; etc',
  9. 'Rules and Corporate Actions']).
  10.  
  11. session('Rule Transformation and Extraction',
  12. ['Transformation and extraction with rule standards; such as SBVR; RIF and OCL',
  13. 'Extraction of rules from code',
  14. 'Transformation and extraction in the context of frameworks such as KDM (Knowledge Discovery meta-model)',
  15. 'Extraction of rules from natural language',
  16. 'Transformation or rules from one dialect into another']).
  17.  
  18. accessList([H|T], H, T).
  19.  
  20. is_empty_string(String) :-
  21. String == ''.
  22. not_empty_string(String) :-
  23. String == ''.
  24.  
  25. get_weight_of_token(MyToken, WeightOfToken) :-
  26. split_string(MyToken,"-","",TempList), % tokenize MyToken into a list ( [string_of_token, weight_of_token] )
  27. accessList(TempList,_,TempWeight), %
  28. accessList(TempWeight,TempWeight2,_), % accessing the tail of the list (weight_of_token)
  29. number_string(WeightOfToken,TempWeight2) % convert string to number
  30.  
  31. ;
  32.  
  33. WeightOfToken is 1.
  34.  
  35. find_relevance([], SessionTitle, SessionTopics).
  36. find_relevance([H | T], SessionTitle, SessionTopics) :-
  37. get_weight_of_token(H, WeightOfToken),
  38. format('Token = ~w with weight = ~d ~n', [H,WeightOfToken]),
  39. format('Title = ~w~nTopics = ~w ~n', [SessionTitle,SessionTopics]),
  40. find_relevance(T, SessionTitle, SessionTopics).
  41.  
  42. query(ListOfKeywords) :-
  43. is_empty_string(ListOfKeywords), write('List of keywords is empty!')
  44.  
  45. ;
  46.  
  47. not_empty_string(ListOfKeywords),
  48. split_string(ListOfKeywords," ","",KeywordsTokens), %tokenize string with space as separator
  49. session(Title,Topics), find_relevance(KeywordsTokens, Title, Topics), fail.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement