This is my all-time favorite bad error message, and one that is specifically fixed in Jess 7. What it's telling you (or not telling you!) is that need-allocation-entity, like allocation-entity, is an unordered template, but you've forgotten the slot names and have written the need-allocation-entity pattern as if it were an ordered template.
I think Mitch Christensen wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Hey, > > I'm getting the following error message in my log file: > > Jess reported an error in routine Jesp.parseLHS > while executing (batch-local recognizers/Columnar.clp). > Message: Expected '<-' . > Program text: ( defrule load-allocation-entities "Load all allocation > entities associated with the parameters" ( need-allocation-entity ?row > ?particid ?firstName at line 56. > > I can't figure why the parser wants to see a '<-'. > > Much of my code is provided below, but I obviously have some local functions > define in Java that I can't provide, (batch-local) being one, which parses a > file retrieved from a URL (rather than disk). > > Any suggestions on the interpretation of this error message given the .clp > file below? > > Thanks. > -Mitch > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; Declare the fact types generated by the OCR engine > (deftemplate page (slot w) (slot h) (slot x-res) (slot y-res) (slot skew)) > (deftemplate region (slot id) (slot type) (slot x) (slot y) (slot width) > (slot height)) > (deftemplate word (slot id) (slot region) (slot x) (slot y) (slot > width)(slot height) > (slot certainty) (slot confidence)(slot text) > (slot type (default TEXT)) ) > (deftemplate ncp-row (slot row)(slot firstname)(slot mi)(slot lastname) > (slot ssn)(slot partic)(slot caseno)(slot county)(slot > amount)) > > ;; Positive File records > (deftemplate allocation-entity (slot row)(slot firstName)(slot > middleInitial) > (slot lastName)(slot suffixName)(slot ssn)(slot caseNo)(slot county) > (slot particid)(slot docketState)(slot docketNumber)(slot docketCounty)) > > ;; Allocation of an amount to an allocation entity > (deftemplate allocation (slot row)) > > ;; determine proximity > (deffunction same-row (?p0 ?p1) (and (< ?p1 (+ ?p0 10) ) > (> ?p1 (- ?p0 10) ) ) ) > > > ;; recognizes money > (deffunction is-money (?t) > (regex-match ?t > > > > > > > > > > > > > > > > > > "^\\$?[\\* ]*([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{2})|[1-9]{1}[0-9]{0, > }(\\.[0-9]{2})|0(\\.[0-9]{0,2})?|(\\.[0-9]{2}))$")) > > > ;; recognizes SSN > (deffunction is-ssn (?t) > (regex-match ?t "[0-9]{3}-?[0-9]{2}-?[0-9]{4}")) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; Module for recognizing columnar formatted remittance pages > (defmodule RECOGNIZE_COLUMNAR) > > (import com.informatixinc.rapid.model.core.remittance.DetailRow) > (import com.informatixinc.rapid.model.core.remittance.Element) > > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; specify which facts support backward chaining > (do-backward-chaining allocation-entity) > > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; try to identify all NCP Name rows (first mi last caseno amnt) > (defrule find-ncp-row > "Find all NCP records" > ?name1 <- (word (text ?tName1) > (x ?xName1) > (y ?rowName1) > (type FIRSTNAME|LASTNAME|TEXT) ) > ?name2 <- (word (text ?tName2) > (x ?xName2&:(< ?xName1 ?xName2)) > (y ?rowName2&:(same-row ?rowName1 ?rowName2)) > (type FIRSTNAME|LASTNAME|TEXT) ) > ?partic <- (word (text ?tPartic&:(regex-match ?tPartic "[0-9]{3,9}")) > (x ?xPartic&:(< ?xName2 ?xPartic)) > (y ?rowPartic&:(same-row ?rowName2 ?rowPartic)) ) > ?amt <- (word (text ?tAmt&:(is-money ?tAmt)) > (x ?xAmt&:(< ?xPartic ?xAmt)) > (y ?rowAmt&:(same-row ?rowPartic ?rowAmt)) ) > (not (ncp-row (row ?rowNcp&:(same-row ?rowName1 ?rowNcp) ) ) ) > => > (printout t "Potential detail row sequence found: '" ?tName1 " " ?tName2 " " > ?tPartic " " ?tAmt " at row " ?rowAmt crlf) > (assert (ncp-row (row ?rowAmt)(firstname ?tName2)(lastname ?tName1) > (partic ?tPartic)(amount ?tAmt)) ) > ) > > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; backward chain to load the Positive File record(s) > (defrule find-allocation-entity > "Find all allocation entities associated with each row" > ?ncp-row <- (ncp-row (row ?row) > (partic ?tPartic) > (firstname ?tFirstName) > (lastname ?tLastName)) > (allocation-entity (row ?row) > (particid ?tPartic) > (firstName ?tFirstName) > (lastName ?tLastName)) > (not (allocation (row ?rowAllocation&:(same-row ?row ?rowAllocation)))) > => > (printout t "Allocation found: " crlf) > ) > > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; perform backward chaining to load a Positive File record > (defrule load-allocation-entities > "Load all allocation entities associated with the parameters" > (need-allocation-entity ?row ?particid ?firstName ?lastName) > => > (printout t "Loading Positive File for " crlf) > (assert (allocation-entry (row 1)(particid 123456) > (firstName fibber)(lastName McGee))) > ) > > -------------------------------------------------------------------- > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' > in the BODY of a message to [EMAIL PROTECTED], NOT to the list > (use your own address!) List problems? Notify [EMAIL PROTECTED] > -------------------------------------------------------------------- > --------------------------------------------------------- Ernest Friedman-Hill Science and Engineering PSEs Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------