Comments (5)
internal static string RemoveTashkeel(string str, out List<TashkeelLocation> tashkeelLocation)
{
tashkeelLocation = new List<TashkeelLocation>();
char[] letters = str.ToCharArray();
int index = 0;
for (int i = 0; i < letters.Length; i++) {
if (letters [i] == (char)0x064B) { // Tanween Fatha
tashkeelLocation.Add (new TashkeelLocation ((char)0x064B, i));
index++;
} else if (letters [i] == (char)0x064C) { // DAMMATAN
tashkeelLocation.Add (new TashkeelLocation ((char)0x064C, i));
index++;
} else if (letters [i] == (char)0x064D){ // KASRATAN
tashkeelLocation.Add (new TashkeelLocation ((char)0x064D, i));
index++;
}else if (letters [i] == (char)0x064E) { // FATHA
if(index > 0)
{
if(tashkeelLocation[index-1].tashkeel == (char)0x0651 ) // SHADDA
{
tashkeelLocation [index - 1].tashkeel = (char)0xFC60; // Shadda With Fatha
continue;
}
}
tashkeelLocation.Add (new TashkeelLocation ((char)0x064E, i));
index++;
} else if (letters [i] == (char)0x064F) { // DAMMA
if (index > 0) {
if (tashkeelLocation [index - 1].tashkeel == (char)0x0651) { // SHADDA
tashkeelLocation [index - 1].tashkeel = (char)0xFC61; // Shadda With DAMMA
continue;
}
}
tashkeelLocation.Add (new TashkeelLocation ((char)0x064F, i));
index++;
} else if (letters [i] == (char)0x0650) { // KASRA
if (index > 0) {
if (tashkeelLocation [index - 1].tashkeel == (char)0x0651) { // SHADDA
tashkeelLocation [index - 1].tashkeel = (char)0xFC62; // Shadda With KASRA
continue;
}
}
tashkeelLocation.Add (new TashkeelLocation ((char)0x0650, i));
index++;
} else if (letters [i] == (char)0x0651) { // SHADDA
if(index > 0)
{
if(tashkeelLocation[index-1].tashkeel == (char)0x064E ) // FATHA
{
tashkeelLocation [index - 1].tashkeel = (char)0xFC60; // Shadda With Fatha
continue;
}
if(tashkeelLocation[index-1].tashkeel == (char)0x064F ) // DAMMA
{
tashkeelLocation [index - 1].tashkeel = (char)0xFC61; // Shadda With DAMMA
continue;
}
if(tashkeelLocation[index-1].tashkeel == (char)0x0650 ) // KASRA
{
tashkeelLocation [index - 1].tashkeel = (char)0xFC62; // Shadda With KASRA
continue;
}
}
tashkeelLocation.Add (new TashkeelLocation ((char)0x0651, i));
index++;
} else if (letters [i] == (char)0x0652) { // SUKUN
tashkeelLocation.Add (new TashkeelLocation ((char)0x0652, i));
index++;
} else if (letters [i] == (char)0x0653) { // MADDAH ABOVE
tashkeelLocation.Add (new TashkeelLocation ((char)0x0653, i));
index++;
}
}
string[] split = str.Split(new char[]{(char)0x064B,(char)0x064C,(char)0x064D,
(char)0x064E,(char)0x064F,(char)0x0650,
(char)0x0651,(char)0x0652,(char)0x0653,(char)0xFC60,(char)0xFC61,(char)0xFC62});
str = "";
foreach(string s in split)
{
str += s;
}
return str;
}
from arabic-support-unity.
Is that the solution?
I would recommend a merge if so.
from arabic-support-unity.
It is working ( at least for me ),,,
Will create a merge request, 👍
from arabic-support-unity.
from arabic-support-unity.
from arabic-support-unity.
Related Issues (20)
- Tashkeels for words with a shadda are restored with the wrong offset HOT 4
- Some Persian letters are not correctly connected HOT 1
- Multibyte languages are erroneously judged. HOT 1
- small issue with combine Tashkeel. HOT 7
- Does not work in WebGL HOT 1
- Numbers and punctuation order changed HOT 7
- proper multi line formating
- IndexOutOfBounds Error HOT 1
- ArabicFixer messes with angle brackets and quotes around {0} format placeholders HOT 5
- a couple of issues when English and Arabic are used in a sentence HOT 2
- string parameters HOT 1
- Is this project still active? HOT 1
- How to use with TMPro RTL enabled? HOT 11
- GUI Text is obselete HOT 4
- TextMeshPro multiline problems HOT 3
- Rich Text formatting work around
- Letter issue
- Order is wrong in mixed-language text HOT 3
- dont work unity 2020.3.24f1
- AlefMaksora is set to Yeh - causing Yeh to be used instead of AlefMaksora after running the Fix HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arabic-support-unity.