Class JSONgenerator


  • public class JSONgenerator
    extends Object
    This class is useful to generate JSON representations / serializations of the core data stuctures that characterize a scientific document.
    • Constructor Detail

      • JSONgenerator

        public JSONgenerator()
    • Method Detail

      • getSentencesJSON

        public static String getSentencesJSON​(Document doc,
                                              SentenceSelectorENUM sentenceSel,
                                              boolean includeTokens,
                                              boolean includeBabelnetSynsets)
        Return the JSON serialization of a set of sentences of the document.
        A list of sentence JSON object is returned; the order of the elements of this list reflects the order of occurrence of each sentence in the document.
        Each sentence JSON object is compliant with the class the structure modeled by the SentenceJSON class.
        Parameters:
        doc -
        sentenceSel -
        includeTokens - true to include the list of tokens of each sentence, each one with lemma and POS
        includeBabelnetSynsets - true to include the list of Babelnet sysets spotted inside each sentence
        Returns:
      • getSentenceJSON

        public static String getSentenceJSON​(Document doc,
                                             Integer sentenceId,
                                             boolean includeTokens,
                                             boolean includeBabelnetSynsets)
        Return the JSON serialization of a sentence of the document (JSON object), identified by its id.
        The sentence JSON object is compliant to the structure modeled by the SentenceJSON class.
        Parameters:
        doc -
        sentenceId -
        includeTokens - true to include the list of tokens of each sentence, each one with lemma and POS
        includeBabelnetSynsets - true to include the list of Babelnet sysets spotted inside each sentence
        Returns:
      • getDocumentJSON

        public static String getDocumentJSON​(Document doc,
                                             boolean includeTokens,
                                             boolean includeBabelnetSynsets)
        Get the JSON serialization of the information contained in the document
        Parameters:
        doc -
        includeTokens - true to include the list of tokens of each sentence, each one with lemma and POS
        includeBabelnetSynsets - true to include the list of Babelnet sysets spotted inside each sentence
        Returns: