happyphone
v1.0.17
Published
Make your phone number nice and easy to remember
Downloads
24
Maintainers
Readme
happyphone
Make your phone number nice and easy to remember
specification
- Choose the language in which to translate the phone number.
- Divide the number into groups of 3 (Including the international prefix, without +).
- For each group of numbers a word is chosen from the dictionary.
- The character '+' is ignored.
- If the group of numbers starts with zero then you ignore it.
examples
+ABCDEFGH is divided into groups of numbers for the dictionary (in the available dictionaries):
ABC = dictionary line
DEF = dictionary line
GH = dictionary line
installation
npm install happyphone
run example (examples directory)
npm start
lint code
npm run tslint
usage
// Typescript
import { HappyPhone } from "happyphone";
var t = new HappyPhone.Converter();
t.happyphone("328274", "ITALIAN", (TAI) => {
console.log(TAI);
});
// ['cedrata', 'buio']
t.happyphone(['cedrata', 'buio'], "ITALIAN", (TAI) => {
console.log(TAI);
});
// ['328', '274']
// Javascript
var _hp = require("happyphone")
var t = new _hp.HappyPhone.Converter();
t.happyphone("328274", "ITALIAN", (TAI) => {
console.log(TAI);
});
// ['cedrata', 'buio']
t.happyphone(['cedrata', 'buio'], "ITALIAN", (TAI) => {
console.log(TAI);
});
// ['328', '274']