<commit_before>import ctypes
import json
import platform

class Alpr():
    def __init__(self, country, config_file, runtime_dir):

        # Load the .dll for Windows and the .so for Unix-based
        if platform.system().lower().find("windows") != -1:
            self._openalprpy_lib = ctypes.cdll.LoadLibrary("openalprpy.dll")
        else:
            self._openalprpy_lib = ctypes.cdll.LoadLibrary("/storage/projects/alpr/src/build/Debug/libopenalprpy.so")


        self._initialize_func = self._openalprpy_lib.initialize
        self._initialize_func.restype = ctypes.c_void_p
        self._initialize_func.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]

        self._dispose_func = self._openalprpy_lib.dispose
        self._dispose_func.argtypes = [ctypes.c_void_p]

        self._is_loaded_func = self._openalprpy_lib.isLoaded
        self._is_loaded_func.argtypes = [ctypes.c_void_p]
        self._is_loaded_func.restype = ctypes.c_bool

        self._recognize_file_func = self._openalprpy_lib.recognizeFile
        self._recognize_file_func.restype = ctypes.c_void_p
        self._recognize_file_func.argtypes = [ctypes.c_void_p, ctypes.c_char_p]

        self._recognize_array_func = self._openalprpy_lib.recognizeArray
        self._recognize_array_func.restype = ctypes.c_void_p
        self._recognize_array_func.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_ubyte), ctypes.c_uint]

        self._free_json_mem_func = self._openalprpy_lib.freeJsonMem<commit_msg>Using generic library path for Python binding<commit_after>import ctypes
import json
import platform

class Alpr():
    def __init__(self, country, config_file, runtime_dir):

        # Load the .dll for Windows and the .so for Unix-based
        if platform.system().lower().find("windows") != -1:
            self._openalprpy_lib = ctypes.cdll.LoadLibrary("openalprpy.dll")
        else:
            self._openalprpy_lib = ctypes.cdll.LoadLibrary("libopenalprpy.so")


        self._initialize_func = self._openalprpy_lib.initialize
        self._initialize_func.restype = ctypes.c_void_p
        self._initialize_func.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]

        self._dispose_func = self._openalprpy_lib.dispose
        self._dispose_func.argtypes = [ctypes.c_void_p]

        self._is_loaded_func = self._openalprpy_lib.isLoaded
        self._is_loaded_func.argtypes = [ctypes.c_void_p]
        self._is_loaded_func.restype = ctypes.c_bool

        self._recognize_file_func = self._openalprpy_lib.recognizeFile
        self._recognize_file_func.restype = ctypes.c_void_p
        self._recognize_file_func.argtypes = [ctypes.c_void_p, ctypes.c_char_p]

        self._recognize_array_func = self._openalprpy_lib.recognizeArray
        self._recognize_array_func.restype = ctypes.c_void_p
        self._recognize_array_func.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_ubyte), ctypes.c_uint]

        self._free_json_mem_func = self._openalprpy_lib.freeJsonMem
{'fraction_non_alphanumeric': 0.09090909090909091, 'fraction_numerical': 0.000666000666000666, 'mean_word_length': 3.4437869822485205, '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': '2340112', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1047, 'n_words': 137}