The E2BWordBank package provides a comprehensive English-to-Bangla word database for easy integration into react and angular applications.
- Retrieve the entire word list.
- Search for words by English term.
- Search for words by Bangla term.
- Find words starting with specific English or Bangla terms.
Install the package using npm:
npm install e2b_word_bank
import {
getAllWords,
findWordByEnglish,
findWordByBangla,
findWordsByEnglishStartWith,
findWordsByBanglaStartWith
} from 'e2b_word_bank';
Retrieve the entire word list.
Array<Object>
: The full list of words, where each item contains English and Bangla fields.
const allWords = getAllWords();
console.log(allWords);
/*
[
{ sl: 1, en: 'A', bn: 'ইংরেজী বর্ণমালার প্রথম বর্ণ' },
{ sl: 2, en: 'A Bad Egg', bn: 'ফালতু লোক' },
...
]
*/
Finds the first item in the word list where the en
field matches the given English term (case-insensitive).
term
:string
- The English term to search for.
Object|null
: The first matching item, ornull
if no match is found.
const match = findWordByEnglish('A');
console.log(match);
/*
{ sl: 1, en: 'A', bn: 'ইংরেজী বর্ণমালার প্রথম বর্ণ' }
*/
Finds the first item in the word list where the bn
field matches the given Bangla term.
term
:string
- The Bangla term to search for.
Object|null
: The first matching item, ornull
if no match is found.
const match = findWordByBangla('লোক');
console.log(match);
/*
{ sl: 2, en: 'A Bad Egg', bn: 'ফালতু লোক' }
*/
Finds all items in the word list where the en
field starts with the given term (case-insensitive).
term
:string
- The English term to search for.
Array<Object>
: A list of matching items.
const matches = findWordsByEnglishStartWith('A');
console.log(matches);
/*
[
{ sl: 1, en: 'A', bn: 'ইংরেজী বর্ণমালার প্রথম বর্ণ' },
{ sl: 2, en: 'A Bad Egg', bn: 'ফালতু লোক' },
...
]
*/
Finds all items in the word list where the bn
field starts with the given Bangla term.
term
:string
- The Bangla term to search for.
Array<Object>
: A list of matching items.
const matches = findWordsByBanglaStartWith('ইংরেজী');
console.log(matches);
/*
[
{ sl: 1, en: 'A', bn: 'ইংরেজী বর্ণমালার প্রথম বর্ণ' }
]
*/
Contributions are welcome! Please feel free to submit a pull request or open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.