-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eca63d8
commit 896d16b
Showing
2 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,62 @@ | ||
# Gurmukhi Utils (Dart) | ||
|
||
Dart library for converting, analyzing, and testing Gurmukhi strings. | ||
Dart library for converting, analyzing, and testing [Gurmukhi](https://en.wikipedia.org/wiki/Gurmukhi) strings. | ||
|
||
## Contribute | ||
## Gurmukhi String Extensions | ||
|
||
If you want to help, please get started with the [CONTRIBUTING.md](CONTRIBUTING.md) doc | ||
### Remove Vishraams | ||
```dart | ||
'ਸਭਨਾ ਜੀਆ ਕਾ, ਇਕੁ ਦਾਤਾ; ਸੋ. ਮੈ ਵਿਸਰਿ ਨ ਜਾਈ ॥੫॥'.removeVishraams(); | ||
// 'ਸਭਨਾ ਜੀਆ ਕਾ ਇਕੁ ਦਾਤਾ ਸੋ ਮੈ ਵਿਸਰਿ ਨ ਜਾਈ ॥੫॥' | ||
``` | ||
|
||
## Related | ||
### First Letters | ||
```dart | ||
'ਜਿਸਨੋ ਕ੍ਰਿਪਾ ਕਰਹਿ ਤਿਨਿ ਨਾਮ ਰਤਨੁ ਪਾਇਆ ॥'.firstGurmukhiLetters(); | ||
// ['ਜ', 'ਕ', 'ਕ', 'ਤ', 'ਨ', 'ਰ', 'ਪ'] | ||
``` | ||
|
||
Gurmukhi Utils comes in many programming languages. [Use the Gurmukhi Utils library in another language](/README.md). | ||
### Split | ||
```dart | ||
'ਕੈਸੀ ਆਰਤੀ ਹੋਇ ॥'.splitGurmukhi(); | ||
// ['ਕੈ', 'ਸੀ', ' ', 'ਆ', 'ਰ', 'ਤੀ', ' ', 'ਹੋ', 'ਇ', ' ', '॥'] | ||
``` | ||
Characters joined by virama `੍` can be split as: | ||
```dart | ||
'ਅੰਮ੍ਰਿਤ'.splitGurmukhi(); | ||
// ['ਅੰ', 'ਮ੍ਰਿ', 'ਤ'] | ||
``` | ||
```dart | ||
'ਅੰਮ੍ਰਿਤ'.splitGurmukhi(splitVirama: true); | ||
// ['ਅੰ', 'ਮ੍', 'ਰਿ', 'ਤ'] | ||
``` | ||
Support SantLipi modifiers: | ||
```dart | ||
'ਸ꠴ਯਾਮ'.splitGurmukhi(extensions: true); | ||
// ['ਸ', '꠴ਯਾ', 'ਮ'] | ||
``` | ||
|
||
### Unicode Normalization | ||
Fix Matras of `ੳ`, `ਅ`, and `ੲ`: | ||
```dart | ||
'ਅਾਦਿ'.normalizeGurmukhi(); | ||
// ਆਦਿ | ||
``` | ||
Fix Order of Diacritics: | ||
```dart | ||
'ਕੰੁਚਰ'.normalizeGurmukhi(); | ||
// ਕੁੰਚਰ | ||
``` | ||
|
||
## Conversion | ||
|
||
### Ascii to Gurmukhi | ||
```dart | ||
asciiToGurmukhi('goibMd imlx kI ieh qyrI brIAw ]'); | ||
// ਗੋਬਿੰਦ ਮਿਲਣ ਕੀ ਇਹ ਤੇਰੀ ਬਰੀਆ ॥ | ||
``` | ||
Support SantLipi modifiers: | ||
```dart | ||
asciiToGurmukhi('qRsîo', extensions: true); | ||
// ਤ੍ਰਸ꠵ਯੋ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters