<commit_before>###
The 'main' script for bootstrapping the default Cilantro client. Projects can
use this directly or emulate the functionality in their own script.
###

require ['cilantro'], (c) ->

    # Session options
    options =
        url: c.config.get('url')
        credentials: c.config.get('credentials')

    # Open the default session defined in the pre-defined configuration.
    # Initialize routes once data is confirmed to be available
    c.sessions.open(options).then ->

        # Register routes and start the session
        @start [
            id: 'query'
            route: 'query/'
            view: new c.ui.QueryWorkflow
                context: @data.contexts.getSession()
                concepts: @data.concepts.queryable
        ,
            id: 'results'
            route: 'results/'
            view: new c.ui.ResultsWorkflow
                view: @data.views.session
                context: @data.contexts.session
                concepts: @data.concepts.viewable
                # The differences in these names are noted
                results: @data.preview
                exporters: @data.exporter
                queries: @data.queries
        ]<commit_msg>Add support for workspace in cilantro/main<commit_after>###
The 'main' script for bootstrapping the default Cilantro client. Projects can
use this directly or emulate the functionality in their own script.
###

require ['cilantro'], (c) ->

    # Session options
    options =
        url: c.config.get('url')
        credentials: c.config.get('credentials')

    # Open the default session defined in the pre-defined configuration.
    # Initialize routes once data is confirmed to be available
    c.sessions.open(options).then ->

        # Define routes
        routes = [
            id: 'query'
            route: 'query/'
            view: new c.ui.QueryWorkflow
                context: @data.contexts.getSession()
                concepts: @data.concepts.queryable
        ,
            id: 'results'
            route: 'results/'
            view: new c.ui.ResultsWorkflow
                view: @data.views.session
                context: @data.contexts.session
                concepts: @data.concepts.viewable
                # The differences in these names are noted
                results: @data.preview
                exporters: @data.exporter
                queries: @data.queries
        ]

        # Workspace supported as of 2.1.0
        if c.isSupported('2.1.0')
            routes.push
                id: 'workspace'
                route: 'workspace/'
                view: c.ui.WorkspaceWorkflow
                    queries: @data.queries

        # Register routes and start the session
        @start(routes)
{'fraction_non_alphanumeric': 0.08782798833819241, 'fraction_numerical': 0.002186588921282799, 'mean_word_length': 1.7259185700099304, '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': '1056008', 'n_tokens_mistral': 726, 'n_tokens_neox': 695, 'n_words': 216}