{'fraction_non_alphanumeric': 0.026362038664323375, 'fraction_numerical': 0.0, 'mean_word_length': 4.7, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, '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}}
A New Algorithm To Evaluate Terminal Heads Of Length K

This paper presents a new FIRSTk(α) algorithm for finding the terminal heads of length k of a given string in a contextfree grammar, which is an alternative to the previous method of Aho and Ullman. Performance study shows the new algorithm in general has better performance, which can be considerable under some scenarios, such as when the input string α is long. The algorithm can be applied in situations such as LL(k) and LR(k) parser generation, and has been actually implemented in a LR(k) parser generator.