geetanjali123

Output

Mar 13th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. // add language to metadata
  2. if (languages != null) {
  3. Graph g = ci.getMetadata();
  4. ci.getLock().writeLock().lock();
  5. try {
  6. for(int i=0;i<maxSuggestedLanguages && i<languages.size();i++){
  7. // add a hypothesis
  8. Language hypothesis = languages.get(i);
  9. IRI textEnhancement = EnhancementEngineHelper.createTextEnhancement(ci, this);
  10. g.add(new TripleImpl(textEnhancement, DC_LANGUAGE, new PlainLiteralImpl(hypothesis.lang)));
  11. g.add(new TripleImpl(textEnhancement, ENHANCER_CONFIDENCE, literalFactory.createTypedLiteral(hypothesis.prob)));
  12. g.add(new TripleImpl(textEnhancement, DC_TYPE, DCTERMS_LINGUISTIC_SYSTEM));
  13. g.add(new TripleImpl(textEnhancement, ENHANCER_CONFIDENCE,
  14. literalFactory.createTypedLiteral(hypothesis.prob)));
Advertisement
Add Comment
Please, Sign In to add comment