npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

myanmar-names

v3.2.0

Published

Sort and search for Myanmar / Burmese names

Downloads

19

Readme

myanmar-names.js

A NodeJS module with three features:

  • Sort a list of Myanmar / Burmese names according to official alphabetic order
  • Remove prefixes from Myanmar / Burmese names
  • Find possible matches for a Myanmar / Burmese name using some matching rules from a large dataset

Client-side use is possible, but throws an error if your user does not have Intl or Myanmar locale support.

Sorting

Removes prefixes and sorts by official alphabetic order (yes, you will need a library for this, not .sort())

On the client-side, this library uses Intl.Collator (available in modern browsers) or throws an error if it's not available. An error is also thrown if the Myanmar locale is not available for sorting. Use a try-catch block.

On the server, you can compile NodeJS with full locale support (brew reinstall node --with-full-icu), follow instructions on how to add more locales to your current install with npm install -g full-icu or use the myanmar-sort module (included in package.json).

Run npm test on this repo and it will print whether it uses the myanmar-sort or Intl.Collator sort.

Usage

In NodeJS, put this first:

var myanmarNameSort = require('myanmar-names').sort;

Pass an array of names:

var names = ["ဦးလှမြင့်", "ဦးမော"];
try {
  output = myanmarNameSort(names);
} catch (e) {
  // fallback
  output = names.sort();
}
> ["ဦးမော", "ဦးလှမြင့်"]

Pass an array of objects, and a function to extract the name:

output = myanmarNameSort(candidates, function(candidate) {
  return candidate.full_name;
});

Matching

Returns the names most likely to match a given name. Removes prefixes, and looks at commonly mistaken and missing letters (like ထ and လ, ဂ and ဝ, commonly missed ီ)

Pass a name string, and an array of potential matches, receive sorted list of best matches:

myanmarNameMatch('ထမြင့်', [
  "ဦးလှမြင့်",
  "ဦးမော"
]);
> ['ဦးလှမြင့်']

Passing a function to extract the names:

myanmarNameMatch('မြင့်', candidates, function(candidate) {
  return candidate.full_name;
});

On NodeJS, use this format:

var myanmarNameMatch = require('myanmar-names').match;

License

Prefixes from Wikipedia under a Creative Commons license

Open Sourced with an MIT License