Initial import

This commit is contained in:
2026-06-04 11:13:34 +01:00
commit 563d9cc96d
143 changed files with 10572 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
class Text {
private $text;
public function __construct($text) {
if (!$text) {
$text = "";
}
$this->text = $this->cleanup($text);
}
function cleanup($text) {
$text = str_replace(" ", " ", $text);
$text = str_replace("\t", " ", $text);
$text = str_replace("\r", " ", $text);
$text = str_replace("\n", " ", $text);
$text = str_replace("\"", "", $text);
$text = str_replace(",", " ", $text);
$text = str_replace("", "-", $text);
$text = str_replace("", "-", $text);
$text = str_replace("Ø", "0", $text);
$text = str_replace("~", "-", $text);
$text = str_replace("--", "-", $text);
$text = preg_replace('/\s\s+/', ' ', $text);
return trim($text);
}
public function get_text() {
return $this->text;
}
public function words() {
$text = preg_replace('/([^A-Z\-0-9]+)/', ' ', strtoupper($this->text));
$words = preg_split('/\s+/', $text);
return $words;
}
}