<commit_before>__author__ = '<NAME>'

# System related libraries
import os
import sys
import re

# Other
from compare import compare
from run_dependency_tests import run_dependency_tests

"""

Class information:

- name: regex4dummies
- version: 1.3.2

"""

# Main class that handles all interaction between the user/programmer and the compare class which does all of the heavy lifting
class regex4dummies:
    # Global compare object. This is global because multiple methods need to be called from the same object
    global compare_object

    # Setting global version variable which contains the version of this library
    __version__ = 'regex4dummies version: 1.3.2'

    # Empty constructor method
    def __init__( self, *args, **kwargs ):
        # Getting global information
        global compare_object

        # Instantiating compare object to be used
        compare_object = compare()

    # Function that is integral in communicating between a compare object and the user
    # This function returns a 3-tuple array containing reliability score, applicability score, and pattern
    def compare_strings( self, parser_name, literal_find, strings_to_process ):
        # Testing the system to make sure all dependencies are installed
        if not literal_find:
            if parser_name == '':
                test_install = run_dependency_tests()
                test_install.test( 'pattern nltk nlpnet' )
            else:
                test_install = run_dependency_tests()
                test_install.test( 'pattern nltk nlpnet' )

        # Getting global variables
        global compare_object

        # Call compare_strings of compare object
        # Return the output from compare_strings
        return compare_object.compare_strings( strings_to_process, literal_find, parser_name )

    # This function returns the information for each sentence/pattern that was identified.
    # This is only useful if semantic parsing is implemented; otherwise, {} will be returned
    def get_sentence_information( self ):
        global compare_object

        return compare_object.get_sentence_information()

# If a user mistakingly runs this library believing it is a program, inform the user that it is not a program
if __name__ == '__main__':
    # Displaying information to the user
    print ""<commit_msg>Fix parser name mistake in tester<commit_after>__author__ = '<NAME>'

# System related libraries
import os
import sys
import re

# Other
from compare import compare
from run_dependency_tests import run_dependency_tests

"""

Class information:

- name: regex4dummies
- version: 1.3.2

"""

# Main class that handles all interaction between the user/programmer and the compare class which does all of the heavy lifting
class regex4dummies:
    # Global compare object. This is global because multiple methods need to be called from the same object
    global compare_object

    # Setting global version variable which contains the version of this library
    __version__ = 'regex4dummies version: 1.3.2'

    # Empty constructor method
    def __init__( self, *args, **kwargs ):
        # Getting global information
        global compare_object

        # Instantiating compare object to be used
        compare_object = compare()

    # Function that is integral in communicating between a compare object and the user
    # This function returns a 3-tuple array containing reliability score, applicability score, and pattern
    def compare_strings( self, parser_name, literal_find, strings_to_process ):
        # Testing the system to make sure all dependencies are installed
        if not literal_find:
            if parser_name == '':
                test_install = run_dependency_tests()
                test_install.test( 'pattern nltk nlpnet' )
            else:
                test_install = run_dependency_tests()
                test_install.test( parser_name )

        # Getting global variables
        global compare_object

        # Call compare_strings of compare object
        # Return the output from compare_strings
        return compare_object.compare_strings( strings_to_process, literal_find, parser_name )

    # This function returns the information for each sentence/pattern that was identified.
    # This is only useful if semantic parsing is implemented; otherwise, {} will be returned
    def get_sentence_information( self ):
        global compare_object

        return compare_object.get_sentence_information()

# If a user mistakingly runs this library believing it is a program, inform the user that it is not a program
if __name__ == '__main__':
    # Displaying information to the user
    print ""
{'fraction_non_alphanumeric': 0.04918733960650128, 'fraction_numerical': 0.00427715996578272, 'mean_word_length': 3.161032028469751, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4798879', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1107, 'n_words': 491}