Documente Academic
Documente Profesional
Documente Cultură
log in or sign up
Search packages
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »
anbani
public
Readme
0 Dependencies
0 Dependents
5 Versions
Anbani is a multifunctional toolkit designed for Georgian Alphabet. Main functionalities include text conversion between various Georgian alphabets via
anbani.core and random text generation via anbani.lorem .
Installation
To install the package simple grab it from npm
Structure
Here's the structure of the package with four main modules: core for conversion and interpretation of letters, lorem for random text generation, data for
accessing the datasets, and toolkit for bonus features.
Minor features from each module are exposed in $ , such as anbani.core.$.* and anbani.lorem.$.* .
anbani
!" core
# !" convert [Function]
# !" interpret [Function]
# $" $
# $" classifyText [Function]
!" lorem
# !" sentences [Function]
# !" paragraphs [Function]
# !" loadWordlist [Function]
# !" names [Function]
# $" $
# !" randomFirstName [Function]
# !" randomLastName [Function]
# $" randomWord [Function]
!" toolkit
# !" friedman [Function]
# !" frequency [Function]
# $" count [Function]
$" data
!" ab
# !" mkhedruli [String]
# !" asomtavruli [String]
# !" nuskhuri [String]
# $" mtavruli [String]
$" lorem
!" firstNames [Array]
!" lastNames [Array]
$" words [Array]
Usage
Initialize package in your app as follows
Conversion
anbani.core.convert supports all of the Georgian unicameral and bicameral alphabets for conversion listed bellow and even more. Note that you may use
Georgian and Latin letters to pass parameters. It's just a less headache.
Georgian also has bicameral styles of the alphabet. If you first hear about that now, check out this article. Generally, automatic capitalization occurs at the beginning
of the sentence. However, you can also append the letter with ' symbol in order to capitalize the word during conversion. This trick also works at anbani.ge as well.
Here's an example
Here are all of the conversions supported. Note that you may convert to any of these types but not all of them are supported to be converted from . In other words,
you can only convert from Mkhedruli, Asomtavruli, Nuskhuri, Mtavruli, and Qwerty, since there is no 1-to-1 relation amongst others.
word sentence
mtavruli
Ⴓ Ⴔ Ⴕ Ⴖ Ⴗ Ⴘ Ⴙ Ⴚ Ⴛ Ⴜ Ⴝ Ⴞ Ⴟ Ⴠ Ⴡ Ⴢ Ⴣ Ⴤ Ⴥ
ⴓ ⴔ ⴕ ⴖ ⴗ ⴘ ⴙ ⴚ ⴛ ⴜ ⴝ ⴞ ⴟ ⴠ ⴡ ⴢ ⴣ ⴤ ⴥ
u f q R y S C c Z w W x j h E I V X H F D Y G L
u f k g y sh ch c dz w' ch' x j h
u p k gh q sh ch ts dz ts' ch' kh j h
Interpretation
Apart from straightforward conversion, the package also supports interpretation capabilities via anbani.core.interpret , which automagically detects the
language of the text and converts to desired to parameter script.
// interpret(TEXT, TO)
// sentences(WORD_COUNT)
anbani.lorem.sentences(10)
// '%-'&/$(', ,$3$)'" 7$0$&!)"$. 8'$.- 7!%$9)$!", :4-".!/$,.!" 7'%)*5'", *;).'#-('%"$ %',%!"<! %2$/"'.'
// paragraphs(
// WORD_COUNT_PER_PARAGRAPH,
// PARAGRAPH_COUNT,
// NEWLINE_CHAR="\n\n"
// )
anbani.lorem.paragraphs(20,3)
7!"('/!"7!! %-'&/$(', 0'%-/,=/)'3$. :4-".!/$,.!", (!/'>!)'"! %'7)'<!. 3!3)',3$"$. 0'%-/,=/)'3$. 7!*9!(! !+/$.!"$
7!%$0/0', %*;!%($, 0'%-&!"!, %-/+-<.! %',%!"<! 0'%-&!"! 0'%8-/+$,! 7!,?/!('., (!#$.4$, ,!.$"',"$.
%2$/"'", (!/!.4/'"- 7!"!9!"(! %!).!+$@$ ,$@2)- :4-".!/$,.!". ,$3$)'", 8!&,$+.!, !4!%(,!7'#'" %-!7&'#! %$/$,<! 7!%$0/0',,
%3'%*),! %-<!($! %3'%*),! 3!3)',3$"$, 7$0/$+!. $<$<-(! 8'$.-, %2$/"'.
,$@2)-, %0/'"-('"- %$/$,<! *;).'#-('%"$ ,!%!3! %-!,'&', 3$),+$. ,$@2)-? 7!%$0/0', ,'/"!! %!).!+$@$ /$%<'. *7!"('7-
!4!%(,!7'#'" %$&,'"$. %9+-, %'7)'<! %3'%*),! %$.&)-, %!%($:&+'!.'
Wordlist was generated using Recurrent Neural Networks (char-rnn - karpathy) that was trained on Georgian epic - Vefxistyaosani. Corresponding repo will be
forthcoming. Note that none of the words generated occur in the training dataset (the poem), but rather are built to mimic underlying constructs of the language. This
makes the text feel fully Georgian while actually meaning nothing (which is good, since you don't need to worry about awkward permutation that might ever occur).
anbani.lorem.sentences(7)
// '#*43!) #*43!) ;*%!"' #' ;!%'", $";+$ 7)!%!<$";+$.'
Toolkit
As some bonus features, you can calculate letter frequency of the text and Friedman score (coincidence index).
anbani.toolkit.friedman(text)
// 0.06116642958748222
anbani.toolkit.frequency(text)
/*
{
'$': 0.09302325581395349,
'2': 0.023255813953488372,
'-': 0.046511627906976744,
'!': 0.13953488372093023,
')': 0.06976744186046512,
'#': 0.023255813953488372,
''': 0.09302325581395349,
'.': 0.046511627906976744,
',': 0.09302325581395349,
'3': 0.023255813953488372,
'/': 0.046511627906976744,
'"': 0.06976744186046512,
'%': 0.046511627906976744,
'5': 0.023255813953488372,
'6': 0.023255813953488372,
'7': 0.023255813953488372
}
*/
RunKit
Here's a RunKit note for the package https://npm.runkit.com/anbani
// Core module
console.log( anbani.core.convert("4!).*+$ !"#!"$", "%&'()*+$", "0!"$1$,'*+$") )
console.log( anbani.core.interpret("vefxistyaosani", "asomtavruli") )
// Lorem module
console.log( anbani.lorem.sentences(7) ) // param: number of words in total
console.log( anbani.lorem.paragraphs(10, 2) ) // params: number of words per paragraph, number of paragraphs
anbani.lorem.loadWordlist([",*@$", ",-*9$"]) // load custom dataset
console.log( anbani.lorem.sentences(7) )
console.log( anbani.lorem.names(3) ) // param: number of names
Cheers,
George A anbani.ge
Keywords
install
npm i anbani
weekly downloads
10
version license
1.1.1 MIT
last publish
2 months ago
collaborators
Documentation
Support / Contact Us
Registry Status
Website Issues
CLI Issues
Security
About npm
About npm, Inc
Jobs
npm Weekly
Blog
Twitter
GitHub
Terms of Use
Code of Conduct
Package Name Disputes
Privacy Policy
Reporting Abuse
Other policies