Skip to main content

Tigrina alphabet processing, which helps to write Tigrina by Tigrina alphabets and other functionalities for manipulation of tigrina words.

Project description

Tigrina alphabets processing library

This application is designed to facilitate the use of Tigrina alphabets for writing and linguistic analysis on computers and mobile devices. It provides a comprehensive set of functions to make working with the Tigrina language more efficient and accessible, whether you are a native speaker, language learner, or researcher.

Key Features

  1. Tigrina Alphabet Input and Conversion:

    • The application allows developers to type and manipulate text using the Tigrina script. It includes features for converting text written in Tigrina alphabets into numeric codes and vice versa, and many more others. Encoding and decoding text in Tigrina is particularly useful for encoding sensitive information or integrating Tigrina text into systems that require numeric data.
  2. Transliteration Support:

    • Users can easily convert Tigrina words written in the English alphabet into the proper Tigrina script. This feature helps bridge the gap for users more familiar with English keyboards but who want to write in Tigrina. So this kind of functionality can developers integrate on their projects for extra Tigrina words functionality to their end users.
  3. Linguistic Tools for Verb, Noun, and Adjective Management:

    • The library includes advanced functions for creating and analyzing verbs, nouns, and adjectives in the Tigrina language. It can generate conjugated verbs from their stems, extract stems from fully conjugated verbs, create noun stems, and manage adjective forms. These functions are invaluable for language learning, grammatical analysis, and content creation in Tigrina.This is also one use of this library that helps developers to integrate such functionality on their projects adds extra further advantages to their end users.
  4. Text Processing and Sentence Management:

    • For ease of translation and text manipulation, the library provides features to break down long sentences into smaller, manageable chunks. This functionality is crucial for accurately translating or processing complex text, making the application versatile for both casual and professional use.

Application Purpose

The primary purpose of this library is to enhance the ability to write, translate, and analyze text in Tigrina using digital devices. By integrating a range of linguistic functions and conversion features, the application supports both everyday communication and more specialized tasks, such as language education, research, and digital content creation. Whether you're composing a message, translating a document, or studying Tigrina grammar, this library offers a streamlined, user-friendly platform for all your needs as a developer to provide your end users.

User Manual: Code Word Functions for Tigrina Language Processing

This manual provides a brief explanation of the functions available in the tigrina_words module for processing Tigrina language text. Each function performs a specific task related to translating, encoding, or identifying Tigrina language elements.

1. Convert Tigrina Alphabet to Numeric Code

  • Function: code_translation("ፈተነ","code","")
  • Description: Converts a Tigrina word or sentence (e.g., "ፈተነ") into its corresponding numeric code. This is useful for encoding Tigrina text.

2. Decode Numeric Code to Tigrina Alphabet

  • Function: code_translation(mycode, 'decode', 'yes')
  • Description: Decodes a numeric code back into the original Tigrina alphabet. The mycode variable contains the numeric code that will be decoded.

3. Convert English-Alphabet Tigrina to Tigrina Alphabet

  • Function: convert_sentence_to_tigrina("ezi natey iyu")
  • Description: Converts Tigrina words written using the English alphabet (e.g., "ezi natey iyu") into the Tigrina alphabet. This helps in converting transliterated text back to its original script.

4. Translate Verb to Be in Tigrina

  • Function: verb_to_be_trans()
  • Description: Provides translations of the verb "to be" in Tigrina across different forms. This function contains a dictionary or lookup table for verb conjugations.

5. Identify Verb to Be and Other Verbs in a Sentence

  • Function: verb_to_be("ይመጽእ ኣሎ")
  • Description: Analyzes a given Tigrina sentence (e.g., "ይመጽእ ኣሎ") to identify and extract the verb "to be" and other verbs present in the sentence. This is useful for linguistic analysis and sentence parsing.

Usage Examples

Each function is designed for specific use cases, such as encoding/decoding text, converting transliterations, or analyzing verbs in Tigrina sentences. For example, if you have a numeric code and need to retrieve the original Tigrina word, use the decoding function with the appropriate parameters.

Additional Functions in tigrina_words Module for Tigrina Language Processing

This section of the manual explains additional functions available in the tigrina_words module that focus on verb and adjective creation, stem extraction, noun processing, and sentence breaking for easier translation or processing.

1. Create Verbs from Stem in Tigrina

  • Function: verb.create_verb_from_stem("መጽአ", 'future', 'we', "he", 'ዘይ', "yes")
  • Description: Generates a complete verb from a given stem verb (e.g., "መጽአ") by specifying tense (e.g., 'future'), subject (e.g., 'we'), subject (e.g., 'he'), and other grammatical markers like negation (e.g., 'ዘይ') and aspect (e.g., "yes"). This is useful for constructing conjugated verbs in various forms.

2. Create Stem Verb from Tigrina Verbs

  • Function: verb.create_stem_from_verb("ኣሲርዎ")
  • Description: Extracts the stem from a given Tigrina verb (e.g., "ኣሲርዎ"). The stem is the base form used to create various conjugations of the verb.

3. Create Stem Noun from Nouns in Tigrina

  • Function: tigrina_words.noun("ቦርሳታት")
  • Description: Extracts the stem form of a noun (e.g., "ቦርሳታት") in Tigrina. The stem noun is the base form that can be used to create plural forms, possessives, and other noun modifications.

4. Create Adjectives from Stem Adjectives in Tigrina

  • Function: adjective.make_adjective_from_stem('ብርቱዕ', '', 'her', '', '', 'እንተዘይ')
  • Description: Constructs a full adjective from a stem (e.g., 'ብርቱዕ') by specifying gender, possession, and negation markers (e.g., 'እንተዘይ' for negation). This is useful for generating descriptive words that match the grammatical context.

5. Create Stem from Adjectives in Tigrina

  • Function: adjective.make_stem_from_adjective('እንተዝብርትዕ')
  • Description: Extracts the stem form of an adjective (e.g., 'እንተዝብርትዕ'), which can be used to create different forms of the adjective based on gender, number, or negation.

6. Break Long Sentences into Chunks

  • Function: break_text("test text here. This is another test.", "")
  • Description: Splits a long sentence or paragraph (e.g., "test text here. This is another test.") into smaller, more manageable chunks. This is particularly useful for processing or translating large texts where sentence-by-sentence translation is required.

Usage Examples

These functions are essential for building or breaking down words and sentences in the Tigrina language, whether for translation, linguistic analysis, or language learning. For instance, if you need to generate a verb from its stem for future tense and a specific subject, you can use the create_verb_from_stem function with the relevant parameters. Similarly, to simplify long translations, you can use the break_text function to segment the content so will be easy for processing or translation as well.

Main Module:

main (from tigrina.main import Tigrina_words as tigrina_words) The main is the main module of this library. It serves as a one-stop solution that integrates all the functionalities provided by the other modules in the package. By importing this main, you will have access to all the features and capabilities of the entire library. This makes it the simplest and most convenient option for users who want to utilize the full potential of the library without having to manage individual imports.

Key Points:

All-in-One Access:

When you import main, you automatically gain access to all other modules, functions, and classes in the library. There's no need for additional imports unless you want to work with specific components separately.

Convenient and Efficient:

This file has been designed to streamline your experience by providing a single point of entry to the entire package. You won't need to worry about missing out on any feature or functionality; it's all included!

Example Usage:
from tigrina.tg_main import Tigrina_words as tigrina_words
Now you can access all the functionality from the entire library!
Importing Individual Modules

While main simplifies the process by consolidating everything into one file, you also have the flexibility to import individual modules separately if needed. This is particularly useful if you only need specific functionalities and want to keep your project lightweight.

Example of Importing Specific Modules:

from module_name import specific_function

Use only the functionality from that specific module
Summary
Full Library Access:

Import main to gain access to all features in the library. Modular Imports: Alternatively, import individual modules separately if you prefer to work with specific components. Whether you choose to work with the entire library or just specific parts, the Tigrinya Alphabet Coder-Decoder library is flexible enough to suit your needs. We hope you find it helpful and easy to use!

from tigrina.tg_main import Tigrina_words as tigrina_words
Functionality

Get Alphabet Family Information

To get the alphabet family of each alphabet:

 get_family_info = tigrina_words.get_family("ይመጽእ")

To get the encoded value of any text:

mycode = tigrina_words.code_translation("ዘይብርትዕቲ ኔራ", 'code','')

Decode Text To decode the encoded text:

 mydecode = tigrina_words.code_translation(mycode, 'decode', 'yes')

Convert English to Tigrina Alphabet To convert any English alphabet-written text into Tigrina alphabet-written text:

 convert = tigrina_words.convert_sentence_to_tigrina("ezi natey iyu")

Convert tigrina to english Alphabet To convert any tigrina alphabet-written text into english alphabet-written text:

 convert = tigrina_words.convert_tigrina_to_english_alphabet("ከመይ ኣለኻ")
 #kemey aleKa

Get Alphabet Information To get a list of functions that help with alphabet retrievals, positions in a family, or other family information:

   tg_alphabets = tigrina_words.alphabet_info

Order Tigrina Words To order Tigrina words in ascending or descending order. For array of objects, provide the column name as an additional parameter:

   orderIt = tigrina_words.order_tg(array, '', 'asc')

Get Verb Translations To get translations of verbs to Tigrina with filtering options:

verbtobetrans = tigrina_words.verb_to_be_trans()

Create Verb from Stem

resultVerb_createVerbFromStemVerb = tigrina_words.verb.create_verb_from_stem("መጽአ", 'future', 'we', "he", 'ዘይ', "yes")

Create Stem from Verb To create a stem from a verb:

resultVerb_createStemFromVerb = tigrina_words.verb.create_stem_from_verb("ኣሲራቶም")
 ```
Create Singular Noun
To create a singular form of a plural noun for easier searching:

resultnoun = tigrina_words.noun("ቦርሳታት")

Create Adjective from Stem
To create an adjective from a stem adjective:

resultAdjective_makeAdjectiveFromStem = tigrina_words.adjective.make_adjective_from_stem('ብርቱዕ', '', 'her', '', '', 'እንተዘይ') ``` Create Stem Adjective from Non-Stem Adjective To create a stem adjective from a non-stem adjective:

resultAdjective_makeStemFromAdjective = tigrina_words.adjective.make_stem_from_adjective('ሓይላ')

Break Long Text into Chunks To break long text into chunks of sentences, separated by periods or commas:

breakingtest = tigrina_words.break_text("test text here. This is another test.", "")

Order Tigrina Words Alphabetically To order arrays or array objects of Tigrina words alphabetically: This is example of ordering array/list

order_alphabetically = tigrina_words.order_tg(['ግደ', 'ጸጋይ', 'ዝፋን', 'ሂወት'], "", "asc")

This is example of ordering array objects, which indicates that the input data is array objects or list of objects in a list or array, then the second paramter will be the field on which the order mechanism will be inplemented. example in this case we need to order de array object by name, hence the second paramter is "name"

order_alphabetically = tigrina_words.order_tg([{"name":'ግደ',"age":40}, {"name":'ጸጋይ',"age":38}, {"name":'ዝፋን',"age":42}, {"name":'ሂወት',"age":52}], "name", "asc")
Database Operations

The package includes CSV samples that contain translations of English to Tigrinya. These files come pre-built with the library, so it can also function as a translation tool. However, caution is needed when working with these files. To extract data, it's recommended to use SQL queries. Specifically, there is a collection of tokenized data that is encrypted. If you wish to use this tokenized data, you must encrypt your input to match the search criteria with the file contents. After retrieving the results, you will need to decrypt them to make the output human-readable. Note that input encryption and output decryption are only required when working with tokenized data.

Select Data from a Table:
result_select = tigrina_words.Data.select("select * from tb1")
Select data from encode table
#first code the word
code=tigrina_words.code_translation("መበቈል","code","")
#create query
query=f"SELECT * from tokenized_data where tg_code like '%{code}%'"
#fetch data from ecoded table based on the query
get_result=tigrina_words.Data.select(query)
# result of the query
print("get_result:",get_result)

When selecting data from a data table or an encoded data table, the result will always be returned as a Pandas DataFrame. However, this DataFrame may not be ideal for manipulating the data. In such cases, you'll need to convert it into a proper data list object. Here's how you can do that:

#tigrina_words.pandas_data_frame_to_object is a class that dynamically convert the pandas dataFrame to list of objects.

result_select=tigrina_words.Data.select("SELECT * from adjectives where word_tigrina='መበቈል'")
print("result_select:",result_select)
#now the above result will be a pandas data frame, which is a bit cumbersome to manipulate it, so we need to change to normalized object list for easy use of the data for extended actions.

normalize_data=tigrina_words.pandas_data_frame_to_object(result_select)
print("normalize_data:",normalize_data)

This way you can manipulate the pandas dataFrame and you can use any ways you want for the converted data. Because the list object are more manipulated in python than pandas.

Insert Data into a Table:
result_insert = tigrina_words.Data.insert("insert into tb1 (id, name, age, city) values(1, 'xegay segid', 38, 'Germany')")
Update Data in a Table:
result_update = tigrina_words.Data.update("update tb1 set name='gide segid test', age=4856 where name='gide segid test'")
Delete Data from a Table:
result_delete = tigrina_words.Data.delete("delete from tb1")
Show All Tables in a Database/File:
result_tables = tigrina_words.Data.get_tables("show tables")
Show All Fields of a Table:
result_fields = tigrina_words.Data.get_fields("describe verbs")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tigrina-0.0.1-py3-none-any.whl (13.0 MB view details)

Uploaded Python 3

File details

Details for the file tigrina-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tigrina-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for tigrina-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48b7441ffae162bc8aeb8708035c5aa1bfe5a8dcd35e710ce1a61628be75e227
MD5 c64193bc4e0ab95393c23c9d36bb78aa
BLAKE2b-256 11e3eeb832f25566f7b577dd8a4f63c9d90fbeabe0d0ae80ad9cca44b4c9f334

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page