<commit_before>package com.pr0gramm.app.ui;

import android.content.Context;

import com.pr0gramm.app.R;
import com.pr0gramm.app.feed.FeedFilter;
import com.pr0gramm.app.feed.FeedType;

public class FeedFilterFormatter {
    private FeedFilterFormatter() {
    }

    /**
     * Simple utility function to format a {@link com.pr0gramm.app.feed.FeedFilter} to some
     * string. The string can not be parsed back or anything interesting.
     *
     * @param context The current context
     * @param filter  The filter that is to be converted into a string
     */
    public static String format(Context context, FeedFilter filter) {
        StringBuilder result = new StringBuilder();

        if(filter.isBasic()) {
            if (filter.getFeedType() == FeedType.PROMOTED)
                result.append(context.getString(R.string.action_feed_type_promoted));

            if (filter.getFeedType() == FeedType.NEW)
                result.append(context.getString(R.string.action_feed_type_new));
        }
        else {
            if (filter.getTags().isPresent())
                result.append(filter.getTags().get());

            if (filter.getUsername().isPresent())
                result.append(context.getString(R.string.filter_format_tag_by)).append(" ").append(filter.getUsername().get());

            if (filter.getLikes().isPresent())
                result.append(context.getString(R.string.filter_format_fav_of)).append(" ").append(filter.getLikes().get());

            result.append(" in ");

            if (filter.getFeedType() == FeedType.PROMOTED)
                result.append(context.getString(R.string.filter_format_top));

            if (filter.getFeedType() == FeedType.NEW)
                result.append(context.getString(R.string.filter_format_new));<commit_msg>Formatierung von Filern verbessert<commit_after>package com.pr0gramm.app.ui;

import android.content.Context;

import com.pr0gramm.app.R;
import com.pr0gramm.app.feed.FeedFilter;
import com.pr0gramm.app.feed.FeedType;

public class FeedFilterFormatter {
    private FeedFilterFormatter() {
    }

    /**
     * Simple utility function to format a {@link com.pr0gramm.app.feed.FeedFilter} to some
     * string. The string can not be parsed back or anything interesting.
     *
     * @param context The current context
     * @param filter  The filter that is to be converted into a string
     */
    public static String format(Context context, FeedFilter filter) {
        StringBuilder result = new StringBuilder();

        if(filter.isBasic()) {
            if (filter.getFeedType() == FeedType.PROMOTED)
                result.append(context.getString(R.string.action_feed_type_promoted));

            if (filter.getFeedType() == FeedType.NEW)
                result.append(context.getString(R.string.action_feed_type_new));
        }
        else {
            if (filter.getTags().isPresent())
                result.append(filter.getTags().get());

            if (filter.getUsername().isPresent())
                result.append(context.getString(R.string.filter_format_tag_by)).append(" ").append(filter.getUsername().get());

            if (filter.getLikes().isPresent()) {
                result.append(context.getString(R.string.filter_format_fav_of)).append(" ").append(filter.getLikes().get());

            } else {
                result.append(" in ");

                if (filter.getFeedType() == FeedType.PROMOTED)
                    result.append(context.getString(R.string.filter_format_top));

                if (filter.getFeedType() == FeedType.NEW)
                    result.append(context.getString(R.string.filter_format_new));
            }
{'fraction_non_alphanumeric': 0.12091503267973856, 'fraction_numerical': 0.0027233115468409588, 'mean_word_length': 2.5764362220058423, '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': '1086720', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1006, 'n_words': 193}