<commit_before>#!/usr/bin/env python

import whitepy.lexer as lexer
from whitepy.lexerconstants import *

import pprint
pp = pprint.PrettyPrinter(width=41, depth=2, compact=True)


with open('./helloworld.ws', 'r') as f:
    lines = f.read()

item = lexer.Lexer(line=lines, debug=True)
item.get_all_tokens()
index = 0
for i in item.tokens:
    index += 1
    print(index)
    pp.pprint([x.type if type(x) == "Token" else x for x in i])<commit_msg>Updated test script to use parser<commit_after>#!/usr/bin/env python

import whitepy.lexer as lexer
import whitepy.parser as ws_parser
from whitepy.lexerconstants import *

import pprint
pp = pprint.PrettyPrinter(width=41, depth=2, compact=True)


#with open('./count.ws', 'r') as f:
with open('./helloworld.ws', 'r') as f:
    lines = f.read()

item = lexer.Lexer(line=lines, debug=True)
item.get_all_tokens()
p = ws_parser.Parser(item.tokens)
p.parse()
#index = 0
#for i in item.tokens:
#    index += 1
#    pp.pprint([x.type if type(x) == "Token" else x for x in i])
{'fraction_non_alphanumeric': 0.1486220472440945, 'fraction_numerical': 0.00984251968503937, 'mean_word_length': 4.2153846153846155, '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': '3245439', 'n_tokens_mistral': 399, 'n_tokens_neox': 385, 'n_words': 105}