<commit_before>package com.mrpowergamerbr.loritta.commands.vanilla.utils

import com.mrpowergamerbr.loritta.commands.AbstractCommand
import com.mrpowergamerbr.loritta.commands.CommandContext
import com.mrpowergamerbr.loritta.utils.LoriReply
import com.mrpowergamerbr.loritta.utils.LorittaUtils
import com.mrpowergamerbr.loritta.utils.locale.LegacyBaseLocale
import com.mrpowergamerbr.loritta.utils.stripCodeMarks
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.utils.Emotes

class CalculadoraCommand : AbstractCommand("calc", listOf("calculadora", "calculator"), CommandCategory.UTILS) {
	companion object {
		const val LOCALE_PREFIX = "commands.utils.calc"
	}

	override fun getUsage(): String {
		return "conta"
	}

	override fun getDescription(locale: LegacyBaseLocale): String {
		return locale["CALC_DESCRIPTION"]
	}

	override fun getExamples(): List<String> {
		return listOf("2 + 2")
	}

	override suspend fun run(context: CommandContext,locale: LegacyBaseLocale) {
		if (context.args.isNotEmpty()) {
			val expression = context.args.joinToString(" ")
					.replace("_", "")

			try {
				// Regra de três:tm:
				if (expression.contains("---")) {
					val split = expression.split("/")
					val firstSide = split[0].split("---")
					val secondSide = split[1].split("---")
					val number0 = firstSide[0].trim()
					val number1 = firstSide[1].trim()

					val number2 = secondSide[0].trim()
					val number3 = secondSide[1].trim()

					val resultNumber0 = LorittaUtils.evalMath(number0)
					val resultNumber1 = LorittaUtils.evalMath(number1)
					val resultNumber2 = LorittaUtils.evalMath(number2)<commit_msg>Adicionado novos exemplos no "+calc"<commit_after>package com.mrpowergamerbr.loritta.commands.vanilla.utils

import com.mrpowergamerbr.loritta.commands.AbstractCommand
import com.mrpowergamerbr.loritta.commands.CommandContext
import com.mrpowergamerbr.loritta.utils.LoriReply
import com.mrpowergamerbr.loritta.utils.LorittaUtils
import com.mrpowergamerbr.loritta.utils.locale.LegacyBaseLocale
import com.mrpowergamerbr.loritta.utils.stripCodeMarks
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.utils.Emotes

class CalculadoraCommand : AbstractCommand("calc", listOf("calculadora", "calculator"), CommandCategory.UTILS) {
	companion object {
		const val LOCALE_PREFIX = "commands.utils.calc"
	}

	override fun getUsage(): String {
		return "conta"
	}

	override fun getDescription(locale: LegacyBaseLocale): String {
		return locale["CALC_DESCRIPTION"]
	}

	override fun getExamples(): List<String> {
		return listOf(
				"2 + 2",
				"40 - 10",
				"5 * 5",
				"100 / 5",
				"(sqrt(10) * 4) / 12",
				"cos(0)",
				"sin(90)",
				"tan(45)",
				"10 % 2"
		)
	}

	override suspend fun run(context: CommandContext,locale: LegacyBaseLocale) {
		if (context.args.isNotEmpty()) {
			val expression = context.args.joinToString(" ")
					.replace("_", "")

			try {
				// Regra de três:tm:
				if (expression.contains("---")) {
					val split = expression.split("/")
					val firstSide = split[0].split("---")
					val secondSide = split[1].split("---")
					val number0 = firstSide[0].trim()
					val number1 = firstSide[1].trim()

					val number2 = secondSide[0].trim()
					val number3 = secondSide[1].trim()

					val resultNumber0 = LorittaUtils.evalMath(number0)
					val resultNumber1 = LorittaUtils.evalMath(number1)
					val resultNumber2 = LorittaUtils.evalMath(number2)
{'fraction_non_alphanumeric': 0.1284692417739628, 'fraction_numerical': 0.01688125894134478, 'mean_word_length': 4.329268292682927, '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': '988703', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1121, 'n_words': 214}