<commit_before>###*
* @preserve Simrou v1.5.3 - Released under the MIT License.
* Copyright (c) 2012 <NAME>, www.buero-fuer-ideen.de
###

class Simrou
    # Cache regular expressions
    RegExpCache:
        extractHash: /^[^#]*(#.*)$/
        trimHash: /^#*(.*?)\/*$/
    
    # Does the user's browser natively support the onHashChange event? 
    eventSupported: do ->
        docMode = window.document.documentMode
        'onhashchange' of window and (not docMode? or docMode > 7)
    
    constructor: (initialRoutes) ->
        # Initialize class members
        @routes = {}
        
        @listening = false
        @observeHash = false
        @observeForms = false
        
        # Create initial routes
        @addRoutes(initialRoutes) if initialRoutes?
    
    # Allows to register a new route with this simrou instance.
    addRoute: (pattern, caseSensitive = true) ->
        route = if pattern instanceof Route then pattern else new Route(pattern, caseSensitive)
        @routes[ route.toString() ] = route
    
    # Allows to bulk register routes.
    addRoutes: (routes, caseSensitive = true) ->
        if jQuery.isFunction(routes)
            list = routes.call(@, caseSensitive)
        else if jQuery.isArray(routes)<commit_msg>Added an optional initialize() method for sub-classes<commit_after>###*
* @preserve Simrou v1.5.4 - Released under the MIT License.
* Copyright (c) 2012 <NAME>, www.buero-fuer-ideen.de
###

class Simrou
    # Cache regular expressions
    RegExpCache:
        extractHash: /^[^#]*(#.*)$/
        trimHash: /^#*(.*?)\/*$/
    
    # Does the user's browser natively support the onHashChange event? 
    eventSupported: do ->
        docMode = window.document.documentMode
        'onhashchange' of window and (not docMode? or docMode > 7)
    
    constructor: (initialRoutes) ->
        # Initialize class members
        @routes = {}
        
        @listening = false
        @observeHash = false
        @observeForms = false
        
        # Create initial routes
        @addRoutes(initialRoutes) if initialRoutes?
        @initialize() if @initialize?
    
    # Allows to register a new route with this simrou instance.
    addRoute: (pattern, caseSensitive = true) ->
        route = if pattern instanceof Route then pattern else new Route(pattern, caseSensitive)
        @routes[ route.toString() ] = route
    
    # Allows to bulk register routes.
    addRoutes: (routes, caseSensitive = true) ->
        if jQuery.isFunction(routes)
            list = routes.call(@, caseSensitive)
        else if jQuery.isArray(routes)
{'fraction_non_alphanumeric': 0.10725308641975309, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 2.407358738501971, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7512267', 'n_tokens_mistral': 753, 'n_tokens_neox': 743, 'n_words': 222}