Skip to content

Commit

Permalink
Add Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
akshdeep-singh committed Jul 20, 2023
1 parent eca63d8 commit 896d16b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 5 deletions.
61 changes: 56 additions & 5 deletions dart/README.md
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);
// ਤ੍ਰਸ꠵ਯੋ
```
2 changes: 2 additions & 0 deletions dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: gurmukhi_utils
description: Utilities for Gurmukhi text.
version: 1.0.0
repository: https://github.com/ShabadOS/gurmukhi-utils/tree/main/dart
topics:
- gurmukhi

environment:
sdk: ^3.0.5
Expand Down

0 comments on commit 896d16b

Please sign in to comment.