<commit_before>﻿@*  (This file is based on /en_US/GetPositions.cshtml, modified)
    This page is called to populate a JSON object with the Position Singular values available for a given Language and Country

    INPUT:
        languageID
        countryID
*@

@{
    // Correct datatype
    Response.ContentType = "application/json";
    
    // Prepare result struct
    var result = new Dictionary<string, object>();
    result["Result"] = -1;
 
    try{
        // Input data
        var term = Request["serviceType"] + "%";
    
        // Process data
        var db = Database.Open("sqlloco");
        var sql = "SELECT distinct PositionSingular, PositionID FROM positions WHERE PositionSingular LIKE @0 and LanguageID = 1 and CountryID = 1";
        var data = db.Query(sql, term);
        
        result["Positions"] = data;
        
        //throw new Exception("Inside Test error");
        
        // Success
        result["Result"] = 0;

    } catch(Exception ex){
        result["ErrorMessage"] = ex.Message;
    }
    
    // Testing loading block:
    //System.Threading.Thread.Sleep(2000);
    //throw new Exception("Test error");
    
    // Output data
    Json.Write(result, Response.Output);
}<commit_msg>GetPositions must return positions ordered by name (PositionSingular)<commit_after>﻿@*  (This file is based on /en_US/GetPositions.cshtml, modified)
    This page is called to populate a JSON object with the Position Singular values available for a given Language and Country

    INPUT:
        languageID
        countryID
*@

@{
    // Correct datatype
    Response.ContentType = "application/json";
    
    // Prepare result struct
    var result = new Dictionary<string, object>();
    result["Result"] = -1;
 
    try{
        // Input data
        var term = Request["serviceType"] + "%";
    
        // Process data
        var db = Database.Open("sqlloco");
        var sql = "SELECT distinct PositionSingular, PositionID FROM positions WHERE PositionSingular LIKE @0 and LanguageID = 1 and CountryID = 1 ORDER BY PositionSingular";
        var data = db.Query(sql, term);
        
        result["Positions"] = data;
        
        //throw new Exception("Inside Test error");
        
        // Success
        result["Result"] = 0;

    } catch(Exception ex){
        result["ErrorMessage"] = ex.Message;
    }
    
    // Testing loading block:
    //System.Threading.Thread.Sleep(2000);
    //throw new Exception("Test error");
    
    // Output data
    Json.Write(result, Response.Output);
}
{'fraction_non_alphanumeric': 0.10857592446892211, 'fraction_numerical': 0.007081038552321007, 'mean_word_length': 2.2897800776196635, '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': '2223147', 'n_tokens_mistral': 710, 'n_tokens_neox': 674, 'n_words': 220}