<commit_before>package extensions;

import play.mvc.Http;
import play.templates.JavaExtensions;

/**
 * @author <NAME> <<EMAIL>>
 */
public class ViewExtensions extends JavaExtensions {

    public static String isCurrent(String action) {
        return Http.Request.current().action.startsWith(action) ? "current" : "";
    }

    public static String pluralize(String singular) {
        return !singular.endsWith("y") ? singular + "s" : singular.substring(0, singular.length() - 1) + "ies";
    }

    public static String shorten(String source, Integer length) {
         return source.length() > length ? source.substring(0, length) + "..." : source;
    }




}

<commit_msg>use contains instead of startsWith to have the currents state trickle down into create and edit mode<commit_after>package extensions;

import play.mvc.Http;
import play.templates.JavaExtensions;

/**
 * @author <NAME> <<EMAIL>>
 */
public class ViewExtensions extends JavaExtensions {

    public static String isCurrent(String action) {
        return Http.Request.current().action.contains(action) ? "current" : "";
    }

    public static String pluralize(String singular) {
        return !singular.endsWith("y") ? singular + "s" : singular.substring(0, singular.length() - 1) + "ies";
    }

    public static String shorten(String source, Integer length) {
         return source.length() > length ? source.substring(0, length) + "..." : source;
    }




}


{'fraction_non_alphanumeric': 0.12854181064270906, 'fraction_numerical': 0.00414651002073255, 'mean_word_length': 3.5109034267912773, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3811037', 'n_tokens_mistral': 413, 'n_tokens_neox': 393, 'n_words': 112}