<commit_before>package com.github.shiraji

import git4idea.GitCommit
import java.math.BigInteger
import java.security.MessageDigest


fun String.toMd5() = BigInteger(1, MessageDigest.getInstance("MD5").digest(this.toByteArray())).toString(16)

fun String.subtract(text: String) = this.replace(text, "")

fun GitCommit.getPullRequestNumber() = this.fullMessage.replace("Merge pull request #", "").split(" ").first().toInt()<commit_msg>Add extensions for GitCommit for finding squashed pull request commit<commit_after>package com.github.shiraji

import git4idea.GitCommit
import java.math.BigInteger
import java.security.MessageDigest


fun String.toMd5() = BigInteger(1, MessageDigest.getInstance("MD5").digest(this.toByteArray())).toString(16)

fun String.subtract(text: String) = this.replace(text, "")

fun GitCommit.getPullRequestNumber() = "Merge pull request #(\\d*)".toRegex().find(this.fullMessage)!!.groups[1]!!.value.toInt()

fun GitCommit.getPullRequestNumberFromSquashCommit() = ".*\\(#(\\d*)\\)".toRegex().find(this.fullMessage)!!.groups[1]!!.value.toInt()

fun GitCommit.isSquashPullRequestCommit() = ".*\\(#(\\d*)\\)".toRegex().containsMatchIn(this.fullMessage)
{'fraction_non_alphanumeric': 0.17346938775510204, 'fraction_numerical': 0.011904761904761904, 'mean_word_length': 6.846666666666667, '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': '5444141', 'n_tokens_mistral': 397, 'n_tokens_neox': 387, 'n_words': 59}