phonetical
v0.1.0
Published
Phonetical is a library to convert text to a phonetic alphabet string
Downloads
8
Maintainers
Readme
Phonetical
Phonetical provides the ability to translate text into a phonetic alphabet string.
This project is still in development. Please report any bugs or feature requests as an issue.
Contents
Getting Started
You can get started with cloning the Phonetical repository by using the following command:
$ git clone [email protected]:ToeFungi/phonetical.git
$ cd phonetical
$ npm i
Installation
Use the following command to install the Phonetical package:
npm i phonetical
Usage
.toPhonetics(text, dictionary)
Convert a string to a phonetic alphabet string.
import { Phonetical, InternationalDictionary } from './Phonetical'
const text = 'Hello there'
const natoTranslation = Phonetical.toPhonetics(text)
const internationalTranslation = Phonetical.toPhonetics(text, InternationalDictionary)
Dictionaries
The library comes with various predefined dictionaries which can be used to translate text into a phonetic string.
- NATO Dictionary
This is the default dictionary. - English Dictionary
- American Dictionary
- Italian Dictionary
- German Dictionary
- International Dictionary
Tests
To run tests, you should be able to simply run be able to run the following.
$ npm run test
$ npm run coverage
The testing framework used is Mocha. Chai and nyc are used for assertions and coverage reporting respectively. Ensure that any new changes are covered by an accompanying test suite.
Issues
If you find any problems while working with this library, please log an issue here so that development can begin to rectify the error.
Contributions
This project is completely open source and as such, you are invited to make contributions. Fork the project, make some changes and make the pull request. If you have any feedback regarding the functionality, please don't hesitate to open an issue so this can be resolved. Please ensure that any pull requests have unit tests that cover any additional functionality.
License
MIT License
Copyright (c) 2021 Alex Pickering