<commit_before><?php
namespace Gettext;

class Translation {
	public $context;
	public $original;
	public $translation;
	public $plural;
	public $pluralTranslation = array();
	public $references = array();
	public $comments = array();

	public function __construct ($context = null, $original = null, $translation = null) {
		$this->setContext($context);
		$this->setOriginal($original);
		$this->setTranslation($translation);
	}

	public function is ($context, $original = null, $plural = null) {
		return (($this->context === $context) && ($this->original === $original) && ($this->plural === $plural)) ? true : false;
	}

	//ORIGINAL STRING
	public function setOriginal ($original) {
		$this->original = $original;
	}

	public function getOriginal () {
		return $this->original;
	}

	public function hasOriginal () {
		return (isset($this->original) && ($this->original !== '')) ? true : false;
	}

	//TRANSLATED STRING
	public function setTranslation ($translation) {
		$this->translation = $translation;
	}

	public function getTranslation () {
		return $this->translation;
	}

	public function hasTranslation () {
		return (isset($this->translation) && ($this->translation !== '')) ? true : false;
	}

	//PLURAL STRING
	public function setPlural ($plural) {
		$this->plural = $plural;
	}

	public function getPlural () {
		return $this->plural;
	}

	public function hasPlural () {
		return (isset($this->plural) && ($this->plural !== '')) ? true : false;
	}

	//PLURAL TRANSLATED STRINGS
	public function setPluralTranslation ($plural, $key = null) {
		if (isset($key)) {
			$this->pluralTranslation[$key] = $plural;
		} else {
			$this->pluralTranslation[] = $plural;
		}
	}

	public function getPluralTranslation ($key = null) {
		if (isset($key)) {
			return isset($this->pluralTranslation[$key]) ? $this->pluralTranslation[$key] : null;
		}

		return $this->pluralTranslation;
	}

	public function hasPluralTranslation () {
		return isset($this->pluralTranslation[0]);
	}

	//CONTEXT
	public function setContext ($context) {
		$this->context = $context;
	}

	public function getContext () {
		return $this->context;
	}

	public function hasContext () {
		return (isset($this->context) && ($this->context !== '')) ? true : false;
	}

	//REFERENCES
	public function addReference ($filename, $line) {
		$this->references[] = array($filename, $line);
	}

	public function hasReferences () {<commit_msg>Translation getters always returns a string<commit_after><?php
namespace Gettext;

class Translation {
	public $context;
	public $original;
	public $translation;
	public $plural;
	public $pluralTranslation = array();
	public $references = array();
	public $comments = array();

	public function __construct ($context = null, $original = null, $translation = null) {
		$this->setContext($context);
		$this->setOriginal($original);
		$this->setTranslation($translation);
	}

	public function is ($context, $original = null, $plural = null) {
		return (($this->context === $context) && ($this->original === $original) && ($this->plural === $plural)) ? true : false;
	}

	//ORIGINAL STRING
	public function setOriginal ($original) {
		$this->original = $original;
	}

	public function getOriginal () {
		return (string)$this->original;
	}

	public function hasOriginal () {
		return (isset($this->original) && ($this->original !== '')) ? true : false;
	}

	//TRANSLATED STRING
	public function setTranslation ($translation) {
		$this->translation = $translation;
	}

	public function getTranslation () {
		return (string)$this->translation;
	}

	public function hasTranslation () {
		return (isset($this->translation) && ($this->translation !== '')) ? true : false;
	}

	//PLURAL STRING
	public function setPlural ($plural) {
		$this->plural = $plural;
	}

	public function getPlural () {
		return (string)$this->plural;
	}

	public function hasPlural () {
		return (isset($this->plural) && ($this->plural !== '')) ? true : false;
	}

	//PLURAL TRANSLATED STRINGS
	public function setPluralTranslation ($plural, $key = null) {
		if (isset($key)) {
			$this->pluralTranslation[$key] = $plural;
		} else {
			$this->pluralTranslation[] = $plural;
		}
	}

	public function getPluralTranslation ($key = null) {
		if (isset($key)) {
			return isset($this->pluralTranslation[$key]) ? (string)$this->pluralTranslation[$key] : null;
		}

		return $this->pluralTranslation;
	}

	public function hasPluralTranslation () {
		return isset($this->pluralTranslation[0]);
	}

	//CONTEXT
	public function setContext ($context) {
		$this->context = $context;
	}

	public function getContext () {
		return $this->context;
	}

	public function hasContext () {
		return (isset($this->context) && ($this->context !== '')) ? true : false;
	}

	//REFERENCES
	public function addReference ($filename, $line) {
		$this->references[] = array($filename, $line);
	}

	public function hasReferences () {
{'fraction_non_alphanumeric': 0.16728167281672818, 'fraction_numerical': 0.0004100041000410004, 'mean_word_length': 4.409090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '2936222', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1508, 'n_words': 365}