geetanjali123

Adding to ci

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