Package edu.upf.taln.dri.lib.model
Class DocCacheManager
- java.lang.Object
-
- edu.upf.taln.dri.lib.model.DocCacheManager
-
public class DocCacheManager extends Object
-
-
Constructor Summary
Constructors Constructor Description DocCacheManager(gate.Document gateDoc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cacheBabelSynsetOcc(BabelSynsetOcc babelSynOcc)
Add a Babelnet synset occurrence to the cache / replace an existing oneboolean
cacheCandidateTerm(CandidateTermOcc cTerm)
Add a candidate term to the cache / replace an existing oneboolean
cacheCitation(Citation cit)
Add a candidate term to the cache / replace an existing oneboolean
cacheSection(Section sect)
Add a section to the cache / replace an existing oneboolean
cacheSentence(Sentence sent)
Add a sentence to the cache / replace an existing oneboolean
cacheToken(Token tok)
Add a token to the cache / replace an existing onevoid
cleanUp()
Clear all object pointersvoid
clearCache()
Clear all cached document elementsBabelSynsetOcc
getCachedBabelSynsetOcc(Integer id)
Get cached Babelnet synset occurrence by id; null if the Babelnet synset occurrence does not exist in cacheCandidateTermOcc
getCachedCandidateTerm(Integer id)
Get cached candidate term by id; null if the candidate term does not exist in cacheCitation
getCachedCitation(Integer id)
Get cached citation by id; null if the citation does not exist in cacheSection
getCachedSection(Integer id)
Get cached section by id; null if the section does not exist in cacheSentence
getCachedSentence(Integer id)
Get cached sentence by id; null if the sentence does not exist in cacheToken
getCachedToken(Integer id)
Get cached token by id; null if the token does not exist in cachegate.Document
getGateDoc()
-
-
-
Constructor Detail
-
DocCacheManager
public DocCacheManager(gate.Document gateDoc) throws InternalProcessingException
- Throws:
InternalProcessingException
-
-
Method Detail
-
getGateDoc
public gate.Document getGateDoc()
-
cacheSentence
public boolean cacheSentence(Sentence sent)
Add a sentence to the cache / replace an existing one- Parameters:
sent
-- Returns:
-
cacheToken
public boolean cacheToken(Token tok)
Add a token to the cache / replace an existing one- Parameters:
tok
-- Returns:
-
cacheSection
public boolean cacheSection(Section sect)
Add a section to the cache / replace an existing one- Parameters:
sect
-- Returns:
-
cacheCandidateTerm
public boolean cacheCandidateTerm(CandidateTermOcc cTerm)
Add a candidate term to the cache / replace an existing one- Parameters:
sect
-- Returns:
-
cacheBabelSynsetOcc
public boolean cacheBabelSynsetOcc(BabelSynsetOcc babelSynOcc)
Add a Babelnet synset occurrence to the cache / replace an existing one- Parameters:
sect
-- Returns:
-
cacheCitation
public boolean cacheCitation(Citation cit)
Add a candidate term to the cache / replace an existing one- Parameters:
sect
-- Returns:
-
getCachedSentence
public Sentence getCachedSentence(Integer id)
Get cached sentence by id; null if the sentence does not exist in cache- Parameters:
id
-- Returns:
-
getCachedToken
public Token getCachedToken(Integer id)
Get cached token by id; null if the token does not exist in cache- Parameters:
id
-- Returns:
-
getCachedSection
public Section getCachedSection(Integer id)
Get cached section by id; null if the section does not exist in cache- Parameters:
id
-- Returns:
-
getCachedCandidateTerm
public CandidateTermOcc getCachedCandidateTerm(Integer id)
Get cached candidate term by id; null if the candidate term does not exist in cache- Parameters:
id
-- Returns:
-
getCachedBabelSynsetOcc
public BabelSynsetOcc getCachedBabelSynsetOcc(Integer id)
Get cached Babelnet synset occurrence by id; null if the Babelnet synset occurrence does not exist in cache- Parameters:
id
-- Returns:
-
getCachedCitation
public Citation getCachedCitation(Integer id)
Get cached citation by id; null if the citation does not exist in cache- Parameters:
id
-- Returns:
-
clearCache
public void clearCache()
Clear all cached document elements
-
cleanUp
public void cleanUp()
Clear all object pointers
-
-