Skip to content

madmansnest/tunhong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Tunhong parser

A library for Ruby 2.0 to mark Chinese and Tibetan strings up inside the text written in another language.

Chinese and Tibetan are defined according to Unicode ranges and Chinese in
fact means CJK. Support for strings in other Unicode ranges might be added
later.

The name is taken after Dunhuang Caves in China, containing important
manuscripts in both Chinese and Tibetan.

Dunhuang spells 燉煌 in Chinese and ཏུན་ཧོང་ in Tibetan. The Tibetan reading
was chosen as the name for the parser.

To illustrate the idea, the result of parsing the first sentence of the
previous paragraph with `TagMarkup` could be:

```Dunhuang spells <span lang="zh">燉煌</span> in Chinese and <span lang="bo">
ཏུན་ཧོང་</span> in Tibetan.```

or it could be:

```Dunhuang spells [c]燉煌[ↄ] in Chinese and [t]ཏུན་ཧོང་[ʇ] in Tibetan.```

depending on the user preference.

Modular design allows writing markups easily to perform different tasks.

All documentation can be found inside the code.

Requirements:

* Ruby 2.0 (works with 1.9 too)
* minitest for running tests

All bugs can be reported and issues can be discussed at the [official GitHub repository](https://github.com/infusiastic/tunhong).

Copyright © 2012-2013 Demian Terentev <demian@infusiastic.me>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

A parser for Ruby 2.0 to mark Chinese and Tibetan strings up inside the text written in another language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages