Skip to content

Commit de8b6cf

Browse files
add examples in README & example.html
1 parent d80efa1 commit de8b6cf

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Can be used in Node.js and the browser.
3333
- **Tatweel Removal**: Remove unnecessary Tatweel characters from Arabic phrases.
3434
- **Convert To Old Arabic**: Transform Arabic text into old script.
3535
- **Tashfeer**: Replaces Arabic text with visually similar characters for encoding purposes.
36+
- **Tashfeer Panned Words**: Replaces Panned Arabic text with visually similar characters for encoding purposes. (Panned words are words that considered as hate speech in social media)
37+
- **Remove Arabic Affixes**: Removes predefined affixes (prefixes and suffixes) from an Arabic word if it starts or ends with those affixes.
3638
- **Word To Letters**: Convert Arabic word to its pronounced letters.
3739

3840
## ⬇️ Installation
@@ -110,6 +112,14 @@ console.log(ArabicServices.tashfeer('هذا النص مشفر'));
110112
// Output: 'هـۮו اڵـݔص مـݭفـݛ'
111113
```
112114

115+
### Tashfeer Panned Words
116+
117+
```javascript
118+
const { ArabicServices } = require('arabic-services');
119+
console.log(ArabicServices.tashfeerPannedWords('جيش العدو يقتل الأطفال'));
120+
// Output: 'چـێـݭ !ڵعـݚۉ ی۪ـڨـټل الأطفال'
121+
```
122+
113123
### Word To Letters
114124

115125
```javascript
@@ -118,6 +128,14 @@ console.log(ArabicServices.wordToLetters('شجرة'));
118128
// Output: شين جيم راء تاء_مربوطة
119129
```
120130

131+
### Remove Arabic Affixes
132+
133+
```javascript
134+
const { ArabicServices } = require('arabic-services');
135+
console.log(ArabicServices.removeAffixes('المدرسة'));
136+
// Output: مدرس
137+
```
138+
121139
<br>
122140

123141
## 💡 Contributing

example.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
),
2626
);
2727
console.log('Tashfeer:', ArabicServices.tashfeer('هذا النص مشفر'));
28+
console.log('tashfeerPannedWords:', ArabicServices.tashfeerPannedWords('جيش العدو يقتل الأطفال'));
2829
console.log('wordToLetters:', ArabicServices.wordToLetters('شجرة'));
30+
console.log('removeArabicAffixes:', ArabicServices.removeArabicAffixes('موظفين'));
31+
2932
console.log('-------- Constants --------');
3033
console.log('ARABIC_DOTLESS_DICT:', ArabicServices.constants.ARABIC_DOTLESS_DICT);
3134
console.log('STANDARD_LETTERS:', ArabicServices.constants.STANDARD_LETTERS);

0 commit comments

Comments
 (0)