Class ObjectGenerator


  • public class ObjectGenerator
    extends Object
    Generates objects of the library starting from the original GATE document annotations
    • Constructor Detail

      • ObjectGenerator

        public ObjectGenerator()
    • Method Detail

      • getSentenceFromId

        public static Sentence getSentenceFromId​(Integer annotationId,
                                                 DocCacheManager cacheManager)
        Sentence Generator method
        Parameters:
        annotationId -
        cacheManager -
        Returns:
      • getTokensFromSentenceId

        public static List<Token> getTokensFromSentenceId​(Integer sentenceId,
                                                          DocCacheManager cacheManager)
        Return the list of tokens given a sentence ID
        Parameters:
        annotationId -
        cacheManager -
        Returns:
      • getSectionFromId

        public static Section getSectionFromId​(Integer annotationId,
                                               DocCacheManager cacheManager)
        Section Generator method
        Parameters:
        annotationId -
        baseDoc -
        Returns:
      • getSectionContainingSentenceId

        public static Section getSectionContainingSentenceId​(Integer sentenceId,
                                                             DocCacheManager cacheManager)
        Get the Section element that contains the sentence with the given Id
        Parameters:
        sentenceId -
        cacheManager -
        Returns:
      • getCandidateTermOccFromId

        public static CandidateTermOcc getCandidateTermOccFromId​(Integer annotationId,
                                                                 DocCacheManager cacheManager)
        Candidate term Generator method
        Parameters:
        annotationId -
        baseDoc -
        Returns:
      • getBabelnetSynsetOccFromId

        public static BabelSynsetOcc getBabelnetSynsetOccFromId​(Integer annotationId,
                                                                DocCacheManager cacheManager)
        Babelnet synset occurrence Generator method
        Parameters:
        annotationId -
        baseDoc -
        Returns:
      • getDepGraphFromSentId

        public static DependencyGraph getDepGraphFromSentId​(Integer annotationId,
                                                            DocCacheManager cacheManager,
                                                            boolean mergeNodes)
        Dependency Graph of sentence Generator method
        Parameters:
        annotationId -
        cacheManager -
        mergeNodes -
        Returns:
      • getCorefTokenIDsets

        public static Map<Integer,​List<Map<Integer,​Set<Integer>>>> getCorefTokenIDsets​(DocCacheManager cacheManager)
        Get a map with all the set of node IDs that are equivalent (i.e. that belong to the same co-reference chain). * KEY: identifier of coref chain (integer) VALUE: List of elements of the coreference chain, each element is a Map with: - KEY: unambiguous id of the coreference chain element - VALUE: set of token IDs (integer) that the coreference chain element includes.
        Parameters:
        cacheManager -
        Returns:
      • getHeaderFromDocument

        public static Header getHeaderFromDocument​(gate.Document gateDoc,
                                                   DocCacheManager cacheManager)
        Header of document Generator method
        Parameters:
        annotationId -
        cacheManager -
        Returns:
      • getCitationFromBibEntry

        public static Citation getCitationFromBibEntry​(gate.Annotation bibEntryAnn,
                                                       DocCacheManager cacheManager)
        Citations of document Generator method
        Parameters:
        annotationId -
        cacheManager -
        Returns: