Package itools :: Package i18n

Package i18n

Classes
  AcceptLanguageType
Functions
 
format_date(x, accept=None)
 
format_datetime(x, accept=None)
 
format_time(x, accept=None)
 
get_accept()
 
get_distance(a, b)
This function was giving by Magnus Lie Hetland.
 
get_language_name(code)
Returns the name of a language.
 
get_languages()
Returns a list of tuples with the code and the name of each language.
 
get_most_similar(a, *args)
Returns the text string from 'args' that is closest to the given string.
 
get_similarity(a, b)
Return a gap and a percent that takes account of abrevations.
 
guess_language(text)
 
has_language(code)
 
init_language_selector(language_selector=<function select_language at 0xd929b0>)
 
is_asian_character(c)
 
is_punctuation(c)
Check if c is a punctuation symbol http://en.wikipedia.org/wiki/Template:Unicode_chart_General_Punctuation General Punctuation Range: 2000–206F
 
is_similar(a, b, limit=0.8)
Returns True if both text strings are close enough, False otherwise.
 
select_language(languages=None)
Function Details

get_distance(a, b)

 
This function was giving by Magnus Lie Hetland. It calculates the gap (mathematical distance) between two strings with the cost of word's translation inside the string.

is_punctuation(c)

 

Check if c is a punctuation symbol http://en.wikipedia.org/wiki/Template:Unicode_chart_General_Punctuation General Punctuation Range: 2000–206F

http://en.wikipedia.org/wiki/Template:Unicode_chart_CJK_Symbols_and_Punctuation CJK Symbols and Punctuation Range: 3000–303F

is_similar(a, b, limit=0.8)

 
Returns True if both text strings are close enough, False otherwise. The optional parameter 'limit' defines the degree of similarity required to be considered 'close enough', it is a float value between '0' (completely different) and '1' (the same string).