1.0.5 • Published 11 months ago
tigrina_alphabets_coder_decoder v1.0.5
Tigrinya alphabets coder and decoder
The "Tigrinya Alphabet Coder and Decoder Mechanism" is a digital tool designed to convert text between the Tigrinya script and english alphabets, and vice versa. This mechanism enables users to input text in Tigrinya, a Ge'ez script used primarily in Eritrea and northern Ethiopia, and encode it into a specified format such as numbers. Conversely, it also decodes encoded messages back into Tigrinya text.
The coder component takes Tigrinya characters as input and transforms them into encoded representations that can be used for secure communication or data storage. The decoder function, on the other hand, interprets these encoded messages, reconstructing the original Tigrinya text.
This tool is essential for applications requiring the secure transmission of Tigrinya language messages, such as in educational, diplomatic, or personal communication contexts. It supports various encoding standards and is user-friendly, with a simple interface for both encoding and decoding tasks, ensuring that the Tigrinya language is accurately preserved and effectively utilized in modern digital communications.
Usage
Import coding.js where you want to call, then see the following to implement. On decoding, there is special thing you should follow, that is the last parameter on the function can be "yes" or "no". If yes then it will should the details of each alphabet in the given context and keep in mind that that can add extra overload in the whole process. Because the that function muches each alphabet on the main array of alphabets and will extract its family.
example, if I don't want to stress the process for using details then use the code like this "codeTranslation(mycode,'decode','no')", so in this case 'no' shows that details of alphabets is not needed anymore so it will skip this functions.
In addition to its encoding and decoding capabilities, the tool is equipped with linguistic analysis features that identify and extract grammatical components of Tigrinya words. Users can input any Tigrinya word, and the mechanism will provide its corresponding verb, noun, and adjective forms. This feature is particularly valuable for language learners, translators, and linguists, as it helps in understanding the morphological structure of Tigrinya words and facilitates more accurate language use.
Whether for secure communication, educational purposes, or linguistic research, this tool ensures that the Tigrinya language is not only preserved in its digital form but also fully utilized through advanced grammatical analysis. The user-friendly interface allows easy access to both encoding/decoding functions and the verb, noun, and adjective extraction features, making it a comprehensive resource for Tigrinya language users.
const code_word=require('./coding').code
let code=code_word.code_translation("ግደ ሰጊድ",'code')
console.log("code:",code)
let decode=code_word.code_translation(mycode,'decode','yes')
console.log("decode:",decode)
var resultVerb_createVerbFromStemVerb=code_word.verb.create_verb_from_stem_verb("መጽእ",'future','we',"he",'ዘይ',"yes")
console.log("createVerbFromStemVerb:",resultVerb_create_verb_from_stem_verb)//output:
//createVerbFromStemVerb: {
// text: 'መጽእ',
// situation: 'future',
// first_person: 'we',
// third_person: 'he',
// negativitiesOrFrontAdditions: 'ዘይ',
// usingLeyLetter: 'yes',
// result_text: 'ዘይክንመጽአሉ'
// }
var resultVerb_createStemFromVerb=code_word.verb.create_stem_from_verb("ይመጽእ")
console.log("resultVerb_createStemFromVerb:",resultVerb_createStemFromVerb)
//output
// resultVerb_createStemFromVerb: {
// mainResult: {
// word: 'ይመጽእ',
// frontErases1: '',
// wordAfterErases1: 'ይመጽእ',
// sentenceType: 'present',
// frontErases2: 'ይ',
// wordAfterErases2: 'መጽእ',
// talkingAbout: '',
// wordType: 'stem_1',
// pronoun: 'he',
// endsHerarchyOfWord: [ 'መጸአ', 'መጽአ', 'ማጸአ', 'መጻአ', 'መጾአ', 'ማጽአ' ]
// }
// }
var resultnoun=code_word.noun("ቦርሳታት")
console.log("resultnoun:",resultnoun)//output:
// resultnoun: {
// possess: '',
// singularity: 'plural',
// noun: [ 'ቦ', 'ር', 'ሳ' ],
// wordChoices: [
// 'ቦርሰ', 'ቦርሱ',
// 'ቦርሲ', 'ቦርሳ',
// 'ቦርሴ', 'ቦርስ',
// 'ቦርሶ'
// ]
// }
var resultAdjective_makeAdjectiveFromStem=code_word.adjective.make_adjective_from_stem('ብርቱዕ','first','her')
console.log("resultAdjective_makeAdjectiveFromStem:",resultAdjective_makeAdjectiveFromStem)////code_word.adjective.make_adjective_from_stem(
//text:'text to make a new word: ሓዲሽ ቃል ክስራሕ ተደልዩ ዘሎ ቃል',
//degree:indicates if there is comparison like greate-first degree, greater-second degree, greatest-third degree,
//ከም መወዳደሪ ንጥቀመሉ ሓረግ ንኣብነት ዝዓቢ፡ ደግሪ ሓደ ክኸውን ከሎ ካብኡ ንሳ ትዓቢ ከኣ ደግሪ ካላኣይ ይከውን፣ ዝዓበየት ተኮይኑ ከኣ ሳልሳይ ደግሪ,
//toWhome: to whom are you talking about, to him, her, me, us,them, you, ነቲ ዛዕባ ጌርካዮ ዘለኻ ሰብ፣ ነኣብነት ፡ ንዑኡ፣ ንዓኣ፣ ንዓኣቶም
//negativity:ዘይ, ኣይ, እንተዘይ, ከይ
//in_comparison_to: her,him,them,you,it example: ሓይልዋ, ስለዚ መን ሓይልዋ ? , ንሱ, ን መን ንዓኣ
//additions: ኣብ መጀመርያ ቃል ዝርከቡ ፊደላት ግን ኣካል ናይቲ ቀንዲ ቃል ዘይኮኑ፣ ናኣብነት ምስዘይሕይላ ፡ ኢዛ ቃል ምስዘይ ኣብ ይሕይላ ተወሲኻ ኣላ ስለዚ ምስዘይ ከምተወሳኪ ቃል ነእትዎ።
//output: ብርትዕቲ
// resultAdjective_makeAdjectiveFromStem: {
// text: 'ብርቱዕ',
// degree: '',
// toWhom: 'him',
// negativity: '',
// in_comparison_to: '',
// additions: 'እንተዘ',
// result_text_tigrina: 'እንተዘበርትዕ',
// result_text_english: 'if he'
// }
var resultAdjective_makeStemFromAdjective=code_word.adjective.make_stem_from_adjective('ብርትዕቲ')
console.log("resultAdjective_makeStemFromAdjective",resultAdjective_makeStemFromAdjective)//output:ብርቱዕ
let text = "test text here. This is another test.";
let breakingtest=code_word.breakText(text,"")
console.log("breakingtest:",breakingtest)
// out put:breakingtest: [ 'test text here.', ' This is another test.', '' ]
Coding and Decoding
This tool allows you to encode and decode text, making it particularly useful for storing encoded text in a database. The encoded text is converted into a long sequence of numbers, making it a numeric value. Storing these numeric values in a database enhances search efficiency, as databases are optimized for fast retrieval of numeric data.
let mycode=code_word.code_translation("ዘይብርትዕቲ ኔራ",'code')
console.log("mycode:",mycode)
let mydecode=code_word.code_translation(mycode,'decode','yes')
console.log("mydecode:",mydecode)
Convert english alphabetical Tigrina sentence to Tigrina written words
This conversion allows you to type Tigrinya text using English alphabets, and then convert it back into Tigrinya script.
let convert=code_word.convert_sentence_to_tigrina("ezi natey iyu")
console.log("convert:",convert)
VerbToBe INFO
This shows any verb to be information on the given text.
The verbToBeTrans is an array of objects that lists all possible forms of the verb "to be" in Tigrinya. Each object contains fields for id, tigrina, and english. By filtering this array based on these fields, you can easily retrieve the translated form of any Tigrinya verb "to be".
The verbToBe(text) function helps to get a verb to be information in a give text.
let verbtobetrans=code_word.verb_to_be_trans()
console.log("verbtobetrans:",verbtobetrans.find((value)=>value.id=67))
let verbtobeInfo=code_word.verbToBe("ክመጽእ ኢየ")
console.log("verbtobeInfo:",verbtobeInfo)
//verbtobeInfo: [
// {
// text: 'ኢየ',
// pronoun: 'i',
// verb: { text: 'ክመጽእ', index: 0 },
// verbToBe: 'will',
// index: 1,
// type: 'verbToBe'
// }
//]
Convert stem to verb
You can create a verb from stem verb
var resultVerb_createVerbFromStemVerb=code_word.verb.create_verb_from_stem_verb("መጽአ",'future','we',"he",'ዘይ',"yes")
console.log("createVerbFromStemVerb:",resultVerb_createVerbFromStemVerb)
//createVerbFromStemVerb: {
// text: 'መጽአ',
// situation: 'future',
// first_person: 'we',
// third_person: 'he',
// negativitiesOrFrontAdditions: 'ዘይ',
// usingLeyLetter: 'yes',
// result_text_tigrina: 'ዘይክንመጽአሉ',
// result_text_english: '',
// is_negative: 'yes'
//}
Convert verb to stem
Just as it's possible to convert a stem into a verb, the reverse is also true—you can create a stem from a verb.
var resultVerb_createStemFromVerb=code_word.verb.create_stem_from_verb("ኣሲራቶም")
console.log("resultVerb_createStemFromVerb:",resultVerb_createStemFromVerb)
// resultVerb_createStemFromVerb: {
// mainResult: {
// word: 'ኣሲራቶም',
// frontErases1: '',
// wordAfterErases1: 'ኣሲራቶም',
// sentenceType: 'past',
// frontErases2: '',
// wordAfterErases2: 'ኣሲራቶም',
// talkingAbout: [ 'ቶም', 'them', 'to them' ],
// wordType: '',
// pronoun: 'she',
// endsHerarchyOfWord: [
// 'ተሰረ', 'ተስረ', 'ታሰረ',
// 'ተሳረ', 'ተሶረ', 'ታስረ',
// 'አሰረ', 'አስረ', 'ኣሰረ',
// 'አሳረ', 'አሶረ', 'ኣስረ'
// ]
// }
// }
noun identification
You can convert a noun to its plural or singular form
var resultnoun=code_word.noun("ቦርሳታት")
console.log("resultnoun:",resultnoun)
// resultnoun: {
// possess: '',
// singularity: 'plural',
// noun: 'ቦርሳ',
// wordChoices: [
// 'ቦርሰ', 'ቦርሱ',
// 'ቦርሲ', 'ቦርሳ',
// 'ቦርሴ', 'ቦርስ',
// 'ቦርሶ'
// ]
// }
Adjectives
You can create adjectives. Converting adjective to stem adjective or vis versa is also one of the task of this library.
var resultAdjective_makeAdjectiveFromStem=code_word.adjective.make_adjective_from_stem('ብርቱዕ','','her','','','እንተዘይ')
console.log("resultAdjective_makeAdjectiveFromStem:",resultAdjective_makeAdjectiveFromStem)
// resultAdjective_makeAdjectiveFromStem: {
// text: 'ብርቱዕ',
// degree: '',
// toWhom: 'her',
// negativity: '',
// in_comparison_to: '',
// additions: 'እንተዘይ',
// result_text_tigrina: 'በርቲዓ',
// result_text_english: ''
// }
var resultAdjective_makeStemFromAdjective=code_word.adjective.make_stem_from_adjective('እንተዘይብርትዓ')
console.log("resultAdjective_make_stem_from_adjective",resultAdjective_makeStemFromAdjective)
//output resultAdjective_makeStemFromAdjective: ብርቱዕ
Breake long sentence into chunks of array items
At the end of the process, sentences need to be broken down into individual chunks, each containing a single sentence. This makes it easier to process, translate, encode, or decode the text. If a sentence contains multiple periods, question marks, or commas, it will be split at these punctuation marks to create an array of sentence chunks. Each chunk in the array can then be processed individually, which simplifies tasks like translation or text encoding and decoding.
let breakingtest=code_word.break_text("test text here. This is another test.","")
console.log("breakingtest:",breakingtest)
//output breakingtest: [ 'test text here.', 'This is another test.' ]
Families and postions of alphabets
You can retrieve the positions and families of any text within the Tigrinya alphabet list. By knowing the position of each character, you can manipulate the text according to your needs. This information is useful for various text processing tasks, such as encoding, decoding, or customizing the text.
let get_family_info=code_word.get_family("ይመጽእ")
console.log("get_family_info:",get_family_info)
// output get_family_info: { families: 'የመጸአ', positions: '6166', text: 'ይመጽእ' }