old_contents: #!/usr/bin/env python
  import os
  
  """
  Performs some core NLP operations as a proof of concept for the library.
  """
  
  from stanford_corenlp_pywrapper import CoreNLP
  
  class StanfordCoreNLP:
      def __init__(self):
          # I don't see anywhere to put properties like this path...
          # For now it's hardcoded and would need to be changed when deployed...
          
          coreNLPPath = os.path.join(os.path.dirname(__file__), '../../lib/stanfordCoreNLP.jar')
          coreNLPModelsPath = os.path.join(os.path.dirname(__file__), '../../lib/stanfordCoreNLPModels.jar')
          self.proc = CoreNLP('pos', corenlp_jars=[coreNLPPath, coreNLPModelsPath])
  
      def run(self, data):
          results = []
          for corpus in data:
              results.append(self.proc.parse_doc(corpus.contents))
          return results
  
new_contents: #!/usr/bin/env python
  import os
  
  """
  Performs some core NLP operations as a proof of concept for the library.
  """
  
  from stanford_corenlp_pywrapper import CoreNLP
  
  class StanfordCoreNLP:
      
      """
      When the JSON segments return from the CoreNLP library, they
      separate the data acquired from each word into their own element.
  
      For readability's sake, it would be nice to pair all of the information
      for a given word with that word, making a list of words with their 
      part of speech tags
      """
      def jsonCleanup(self, data):
        for corpus in data:
            res = self.proc.parse_doc(corpus.contents)
            for sentence in res["sentences"]:
              words = [] 
              for index, token in enumerate(sentence["tokens"]):
                word = {}
  
                word["token"] = sentence["tokens"][index]
                word["lemma"] = sentence["lemmas"][index]
                word["part-of-speech"] = sentence["pos"][index]
  
                words.append(word)
  
        return words
  
  
      def __init__(self):
          coreNLPPath = os.path.join(os.path.dirname(__file__), '../../lib/stanfordCoreNLP.jar')
          coreNLPModelsPath = os.path.join(os.path.dirname(__file__), '../../lib/stanfordCoreNLPModels.jar')
          self.proc = CoreNLP('pos', corenlp_jars=[coreNLPPath, coreNLPModelsPath])
  
      def run(self, data):
          return self.jsonCleanup(data) 
  
  
subject: Format JSON to be collections of tokens