<commit_before>package sst.com.anouncements.feed.model

import org.apache.commons.text.StringEscapeUtils
import java.text.SimpleDateFormat
import java.util.*

data class Entry(
    val id: String,
    val publishedDate: Date,
    val updatedDate: Date,
    val authorName: String,
    val url: String,
    val title: String,
    val content: String
) {
    val relativePublishedDate: String by lazy { relativeDate(publishedDate) }

    val contentWithoutHTML: String by lazy {
        // Remove any content in style tags
        var content = this.content.replace("<style[^>]*>.*</style>".toRegex(), "")
        // Remove HTML tags
        content = content.replace("<[^>]*>".toRegex(), "")
        // Unescape characters, e.g. converting &lt; to <
        StringEscapeUtils.unescapeHtml4(content).trim()
    }

    private fun relativeDate(date: Date): String {
        // TODO: Make the date more relative, like "today", "3 days ago"
        val dateFormat = SimpleDateFormat("d MMM", Locale.getDefault())
        return dateFormat.format(date)
    }

    override fun equals(other: Any?) =
        other is Entry &&
        id == other.id &&
        updatedDate.compareTo(other.updatedDate) == 0

    override fun hashCode() = (id + updatedDate).hashCode()
}<commit_msg>Convert Entry model to a parcelable<commit_after>package sst.com.anouncements.feed.model

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import org.apache.commons.text.StringEscapeUtils
import java.text.SimpleDateFormat
import java.util.*

@Parcelize
data class Entry(
    val id: String,
    val publishedDate: Date,
    val updatedDate: Date,
    val authorName: String,
    val url: String,
    val title: String,
    val content: String
) : Parcelable {
    val relativePublishedDate: String by lazy { relativeDate(publishedDate) }

    val contentWithoutHTML: String by lazy {
        // Remove any content in style tags
        var content = this.content.replace("<style[^>]*>.*</style>".toRegex(), "")
        // Remove HTML tags
        content = content.replace("<[^>]*>".toRegex(), "")
        // Unescape characters, e.g. converting &lt; to <
        StringEscapeUtils.unescapeHtml4(content).trim()
    }

    private fun relativeDate(date: Date): String {
        // TODO: Make the date more relative, like "today", "3 days ago"
        val dateFormat = SimpleDateFormat("d MMM", Locale.getDefault())
        return dateFormat.format(date)
    }

    override fun equals(other: Any?) =
        other is Entry &&
        id == other.id &&
        updatedDate.compareTo(other.updatedDate) == 0

    override fun hashCode() = (id + updatedDate).hashCode()
}
{'fraction_non_alphanumeric': 0.12063134160090191, 'fraction_numerical': 0.002254791431792559, 'mean_word_length': 3.0090361445783134, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5713188', 'n_tokens_mistral': 771, 'n_tokens_neox': 756, 'n_words': 217}