forked from donnekgit/andika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert_ar_rom.php
55 lines (42 loc) · 1.75 KB
/
convert_ar_rom.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
*********************************************************************
Copyright Kevin Donnelly 2012.
kevindonnelly.org.uk
This file is part of Andika!, a set of tools for writing Swhili in Arbic script..
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License or the GNU
Affero General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
and the GNU Affero General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
*********************************************************************
*/
mb_internal_encoding("UTF-8");
include("./includes/fns.php");
$input=trim($_POST['ar_rom_in']);
//echo $mystring."<br />";
// Truncate the text to 900 characters, and strip HTML/PHP tags.
$input=strip_tags(substr($input, 0, 900));
// Retain line-breaks.
$input=nl2br($input);
// Give a one-to-one transliteration of the Arabic glyphs into Roman letters.
$translit=ar2rom($input);
echo $translit."<br />";
// Now smooth the transliteration to give a standard transcription.
// The most obvious smoother is for the standard Swahili orthography.
// But others are possible, eg for close transcription.
$standard=standardise($translit);
$close=close_trans($translit);
//echo "Standard: ".$standard."<br />";
echo "<p class=\"\">";
// echo $close."<br /><br />";
echo $standard."<br />";
echo "</p>";
?>