Skip to content

Commit

Permalink
Merge pull request #13 from ageekdev/feat/enhancements
Browse files Browse the repository at this point in the history
Enhancements
  • Loading branch information
tintnaingwinn authored Sep 2, 2024
2 parents 14831ed + f92b08f commit ed91f40
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 9 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ phpstan.neon
testbench.yaml
vendor
node_modules
.DS_Store
1 change: 1 addition & 0 deletions config/en-exceptional-names.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
'thein gi' => 'theingi',
'thu zar' => 'thuzar',
'a pril' => 'april',
'na di' => 'nadi',
];
13 changes: 10 additions & 3 deletions config/en-names-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
'nwal' => 'နွယ်',
'nwe' => 'နွယ်',
'paing' => 'ပိုင်',
'pai' => 'ပိုင်',
'phoo' => 'ဖူး',
'phu' => 'ဖူး',
'phue' => 'ဖူး',
Expand Down Expand Up @@ -261,7 +262,8 @@
'haine' => 'ဟိန်း',
'hein' => 'ဟိန်း',
'mee' => 'မီး',
'mu' => 'မုစ်',
'mu' => 'မူး',
'klu' => 'ကလူ',
'dra' => 'ဒြာ',
'hmone' => 'မှုံ',
'mhone' => 'မှုံ',
Expand Down Expand Up @@ -313,6 +315,7 @@
'maw' => 'မော်',
'mon' => 'မွန်',
'ye' => 'ရဲ',
'yair' => 'ရဲ',
'wit' => 'ဝတ်',
'wuit' => 'ဝတ်',
'wutt' => 'ဝတ်',
Expand All @@ -338,6 +341,7 @@
'pan' => 'ပန်',
'thwin' => 'သွင်',
'naing' => 'နိုင်',
'nai' => 'နိုင်',
'hsu' => 'ဆု',
'zue' => 'ဇူး',
'zuu' => 'ဇူး',
Expand Down Expand Up @@ -955,7 +959,7 @@
'juu' => 'ဂျူး',
'nyeint' => 'ညိမ့်',
'now' => 'နိုး',
'pyi' => 'ပြီ',
'pyi' => 'ပြည်',
'snadar' => 'စန္ဒာ',
'dai' => 'ဒိုင်',
'daing' => 'ဒိုင်း',
Expand Down Expand Up @@ -1439,7 +1443,7 @@
'm' => 'အမ်',
'nap' => 'နပ်',
'ama' => 'အမ္မ',
'ann' => 'အမ်း',
'ann' => 'အန်း',
'aeh' => 'အဲမ်',
'om' => 'အိုမ်',
'aeinvar' => 'အိမ္ဗာ',
Expand Down Expand Up @@ -1491,4 +1495,7 @@
'waiyan' => '၀ေယံ',
'thuzar' => 'သူဇာ',
'yupar' => 'ရူပါ',
'mary' => 'မေရီ',
'nady' => 'နဒီ',
'nadi' => 'နဒီ',
];
3 changes: 2 additions & 1 deletion config/mm-names-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
'အူရ်' => 'eu',
'နီ' => 'ni',
'ငု' => 'ngu',
'စန္ဒီ' => 'sundy',
'စန္ဒီ' => 'sandy',
'လွှာ' => 'lhwar',
'သို့' => 'thot',
'ခွါ' => 'khwar',
Expand Down Expand Up @@ -1402,4 +1402,5 @@
'သီင်္ဂီ' => 'theingi',
'သူဇာ' => 'thuzar',
'ရူပါ' => 'yupar',
'နဒီ' => 'nady',
];
5 changes: 2 additions & 3 deletions tests/NameCheckingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@

it('can check myan-glish names', function () {
$result = MMName::isEnName('Tun Kyaw သက်');

expect($result)->toBeFalse();

$result = MMName::isEnName('Tun Kyaw Soe');

expect($result)->toBeTrue();
});

it('can check myanmar names', function () {
$result = MMName::isMmName('သီဟ ကျော်');
expect($result)->toBeTrue();

$result = MMName::isMmName('ရဲဝင်းထွဋ်');
expect($result)->toBeTrue();

$result = MMName::isMmName('သီဟ Kyaw');

expect($result)->toBeFalse();
});
3 changes: 3 additions & 0 deletions tests/NameComparisonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@

$result = MMName::compare('အာကာမြင့်အောင်', 'အာကာမြင့်အောင်');
expect($result)->toBeTrue();

$result = MMName::compare('Yair', 'Ye');
expect($result)->toBeTrue();
});
30 changes: 28 additions & 2 deletions tests/NameConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,26 @@

$result = MMName::convertToMm('Arkar Myint Aung');
expect($result)->toEqual('အာကာမြင့်အောင်');

$result = MMName::convertToMm('Yair Win Htut');
expect($result)->toEqual('ရဲဝင်းထွဋ်');

$result = MMName::convertToMm('Nadi Pwint');
expect($result)->toEqual('နဒီပွင့်');

$result = MMName::convertToMm('Nady Pwint');
expect($result)->toEqual('နဒီပွင့်');

$result = MMName::convertToMm('Sandy Sandi');
expect($result)->toEqual('စန္ဒီစန္ဒီ');
});

it('can convert myanmar name to myan-glish', function () {
$result = MMName::convertToEn('စန္ဒီစန္ဒီ');
expect($result)->toEqual('Sandy Sandy');

$result = MMName::convertToEn('နဒီပွင့်');
expect($result)->toEqual('Nadi Pwint');

$result = MMName::convertToEn('အာကာမြင့်အောင်');
expect($result)->toEqual('Arkar Myint Aung');
Expand All @@ -81,6 +98,9 @@
$result = MMName::convertToEn('ယဥ်မာအေး');
expect($result)->toEqual('Yin Mar Aye');

$result = MMName::convertToEn('ယဉ်မာအေး');
expect($result)->toEqual('Yin Mar Aye');

$result = MMName::convertToEn('ဦးကိုကို');
expect($result)->toEqual('U Ko Ko');

Expand All @@ -93,8 +113,14 @@
$result = MMName::convertToEn('မောင်မောင်');
expect($result)->toEqual('Maung Maung');

$result = MMName::convertToEn('မောင်မောင်');
expect($result)->toEqual('Maung Maung');
$result = MMName::convertToEn('ခိုင်သင်ဇာ');
expect($result)->toEqual('Khine Thinzar');

$result = MMName::convertToEn('ဥက္ကာမိုး');
expect($result)->toEqual('Oakkar Moe');

$result = MMName::convertToEn('ရဲဝင်းထွဋ်');
expect($result)->toEqual('Ye Win Htut');

$result = MMName::convertToEn('လွမ်းထူး');
expect($result)->toEqual('Lwan Htue');
Expand Down

0 comments on commit ed91f40

Please sign in to comment.