<commit_before>import sys
from langtools.utils import readkr
import matcher


def find_next_kr(string):
    
    first = len(string)
    last = first 
    for index, char in enumerate(string):
        if char !=' ':
           first = index
           break
    last_char = '@'
    current = first
    for index, char in enumerate(string[first:]):
        if char.isupper() and (last_char == ')' or last_char == '>'):
            last = current
            break      
        elif char != ' ':
            last_char = char
            current = index
    return string[first:first + last + 1], string[first + last + 1:] 

   
def parse_rule(rule):
    right = rule.split('->')[1]
    matchers = []
    while len(right) > 0:
        kr, right = find_next_kr(right)
        if kr != '':
            kr_dict = readkr.kr_to_dictionary('stem/' + kr)
            pattermatch = matcher.PatternMatcher(kr_dict)
        matchers.append(pattermatch)
    return matchers

     
        
def main():
    rules = sys.stdin.readlines()
    for rule in rules:<commit_msg>find_next_kr replaced with a simple split()<commit_after>import sys
from langtools.utils import readkr
import matcher

def parse_rule(rule):
    right = rule.split('->')[1].strip()
    matchers = []
    for kr in right.split():        
            kr_dict = readkr.kr_to_dictionary('stem/' + kr)
            pattermatch = matcher.PatternMatcher(kr_dict)
            matchers.append(pattermatch)
    return matchers

def main():
    rules = sys.stdin.readlines()
    for rule in rules:
{'fraction_non_alphanumeric': 0.11291369240752758, 'fraction_numerical': 0.003244646333549643, 'mean_word_length': 2.2058212058212057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7083044', 'n_tokens_mistral': 482, 'n_tokens_neox': 463, 'n_words': 120}