<commit_before>import json
#from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
import jsonrpclib
import fileinput
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir) 
import ppp_nlp_classical

class StanfordNLP:
    def __init__(self, port_number=8080):
        self.server = jsonrpclib.Server("http://localhost:%d" % port_number)

    def parse(self, text):
        return json.loads(self.server.parse(text))

def get_answer():
    nlp = StanfordNLP()
    result = nlp.parse(input(""))
    tree = ppp_nlp_classical.computeTree(result['sentences'][0])
    qw = ppp_nlp_classical.simplify(tree)
    return ppp_nlp_classical.buildTree(ppp_nlp_classical.buildBucket(tree,qw))

print(get_answer().as_json())<commit_msg>Make the output of demo6.py use indentation.<commit_after>import json
#from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
import jsonrpclib
import fileinput
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir) 
import ppp_nlp_classical

class StanfordNLP:
    def __init__(self, port_number=8080):
        self.server = jsonrpclib.Server("http://localhost:%d" % port_number)

    def parse(self, text):
        return json.loads(self.server.parse(text))

def get_answer():
    nlp = StanfordNLP()
    result = nlp.parse(input(""))
    tree = ppp_nlp_classical.computeTree(result['sentences'][0])
    qw = ppp_nlp_classical.simplify(tree)
    return ppp_nlp_classical.buildTree(ppp_nlp_classical.buildBucket(tree,qw))

print(json.dumps(get_answer().as_dict(), indent=4))
{'fraction_non_alphanumeric': 0.12384473197781885, 'fraction_numerical': 0.011090573012939002, 'mean_word_length': 5.368627450980392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5234793', 'n_tokens_mistral': 584, 'n_tokens_neox': 565, 'n_words': 96}