Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add language to metadata
- if (languages != null) {
- Graph g = ci.getMetadata();
- ci.getLock().writeLock().lock();
- try {
- for(int i=0;i<maxSuggestedLanguages && i<languages.size();i++){
- // add a hypothesis
- Language hypothesis = languages.get(i);
- IRI textEnhancement = EnhancementEngineHelper.createTextEnhancement(ci, this);
- g.add(new TripleImpl(textEnhancement, DC_LANGUAGE, new PlainLiteralImpl(hypothesis.lang)));
- g.add(new TripleImpl(textEnhancement, ENHANCER_CONFIDENCE, literalFactory.createTypedLiteral(hypothesis.prob)));
- g.add(new TripleImpl(textEnhancement, DC_TYPE, DCTERMS_LINGUISTIC_SYSTEM));
- g.add(new TripleImpl(textEnhancement, ENHANCER_CONFIDENCE,
- literalFactory.createTypedLiteral(hypothesis.prob)));
- }
Advertisement
Add Comment
Please, Sign In to add comment