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

from nodes import Node

class PuncSplit(Node):
    char = ".c"
    args = 1
    results = 1
    
    @Node.test_func(["I went to the shop."], [["I", "went", "to", "the", "shop"]])
    @Node.test_func(["bob-bob is sad."], [["bob-bob", "is", "sad"]])
    @Node.test_func(["Why?"], [["Why"]])
    @Node.test_func(["He, She, It."], [["He", "She", "It"]])
    def split(self, inp:str):
        """Split by space and remove punctuation"""
        inp = inp.split()
        rtn = []
        for i in inp:
            if i[-1] in ".,;'\"!?\\/])}":
                i = i[:-1]
            if i[0] in "[({":
                i = i[1:]
            rtn.append(i)
        return [rtn]
        <commit_msg>Allow ellipsis as punctuation<commit_after>#!/usr/bin/env python

from nodes import Node

class PuncSplit(Node):
    char = ".c"
    args = 1
    results = 1
    
    @Node.test_func(["I went to the shop."], [["I", "went", "to", "the", "shop"]])
    @Node.test_func(["bob-bob is sad."], [["bob-bob", "is", "sad"]])
    @Node.test_func(["Why?"], [["Why"]])
    @Node.test_func(["He, She, It."], [["He", "She", "It"]])
    def split(self, inp:str):
        """Split by space and remove punctuation"""
        inp = inp.split()
        rtn = []
        for i in inp:
            if i.endswith("..."):
                i = i[:-3]
            if i[-1] in ".,;'\"!?\\/])}":
                i = i[:-1]
            if i[0] in "[({":
                i = i[1:]
            rtn.append(i)
        return [rtn]
        
{'fraction_non_alphanumeric': 0.2309197651663405, 'fraction_numerical': 0.008480104370515329, 'mean_word_length': 1.789090909090909, 'pattern_counts': {'":': 4, '<': 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': '1276729', 'n_tokens_mistral': 598, 'n_tokens_neox': 573, 'n_words': 141}