I am trying to figure out where this code might die, and why we don't se
the Exception, if there is an Exception.
Inside of a try/catch block, we have this, when calls a library written in
Java:
(timbre/log :trace " in parse-sentence fields-and-labels is: "
fields-and-labels)
(let [
instance-of-sentence-parser @nlp-engine
sentence-parse-response-map (.init instance-of-sentence-parser
(:incoming-message
this-users-conversation)
organization
accounts
contacts
required-fields
fields-and-labels)
]
(timbre/log :trace " in parse-sentence sentence-parse-response-map is: "
sentence-parse-response-map)
We get to the first of these log statements, but not the second. The Java
function we call looks like this:
public HashMap<String,String> init(String debrief,String companyName,
Collection contacts, Collection accounts, Collection requiredFields, Map
fieldLabelMap) {
try {
System.out.println("The house is inside the nlp init.");
ArrayList<String> ct = new
ArrayList(Arrays.asList(contacts.toArray(new String[0])));
ArrayList<String> ac = new
ArrayList(Arrays.asList(accounts.toArray(new String[0])));
ArrayList<String> rq = new
ArrayList(Arrays.asList(requiredFields.toArray(new String[0])));
HashMap<String,String> flMap = new HashMap<>(fieldLabelMap);
System.out.println("init method has ended.");
return transformer.transform(debrief, companyName,
tecClassifier, rollioClassifier, caseClassifier, caselessClassifier,
customClassifier, pipeline, parser, props, firstNames, lastNames, ac, ct,
rq, flMap);
} catch (Exception e) {
System.out.println("Top level Exception in Main::main" +
e.getMessage());
e.printStackTrace();
}
return null;
}
And it gets as far as :
System.out.println("init method has ended.");
The transform function looks like:
public HashMap<String,String> transform(String debrief, String
companyName, AbstractSequenceClassifier<CoreLabel> tecClassifier,
AbstractSequenceClassifier<CoreLabel>
amaranClassifier,AbstractSequenceClassifier<CoreLabel>
caseClassifier,AbstractSequenceClassifier<CoreLabel> caselessClassifier,
AbstractSequenceClassifier<CoreLabel> customClassifier,StanfordCoreNLP
pipeline, Parser parser, Properties props,String[] firstNames, String[]
lastNames, ArrayList<String> acctMp, ArrayList<String> contactMap,
ArrayList<String> requiredFields, HashMap fieldLabelMap) {
try {
if (companyName.equals("Amaran")) {
AmaranSFInfoExtractor sfInfoExtractor = new
AmaranSFInfoExtractor(debrief, pipeline, parser, amaranClassifier,
caseClassifier, caselessClassifier, customClassifier, props, firstNames,
lastNames, acctMp, contactMap, requiredFields, fieldLabelMap);
sfInfoExtractor.extract();
return deNestMap(sfInfoExtractor.tagMap);
} if (companyName.equals("TEC")) {
TECSFInfoExtractor sfInfoExtractor = new
TECSFInfoExtractor(debrief, pipeline, parser, tecClassifier,
caseClassifier, caselessClassifier, customClassifier, props, firstNames,
lastNames, acctMp, contactMap, requiredFields, fieldLabelMap);
sfInfoExtractor.extract();
return deNestMap(sfInfoExtractor.tecTagMap);
}
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
return new HashMap<>();
}
Where does this die? And why don't we see the Exception?
What could we do to make the Exception visible, assuming there is one?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.