Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
fayland committed Oct 11, 2015
1 parent 99988b0 commit 3e7143e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Lingua::Unihan

[![Build Status](https://travis-ci.org/fayland/perl6-Lingua-Unihan.svg?branch=master)](https://travis-ci.org/fayland/perl6-Lingua-Unihan)

```
use Lingua::Unihan;
my $codepoint = unihan_codepoint('你'); # 4f60
my $mandarin = unihan_query('kMandarin', '林'); # 'lín'
my $strokes = unihan_query('kTotalStrokes', '林'); # 8
```

## Supported Filed Type

* kCangjie
* kCantonese
* kCheungBauer
* kCihaiT
* kDefinition
* kFenn
* kFourCornerCode
* kFrequency
* kGradeLevel
* kHDZRadBreak
* kHKGlyph
* kHangul
* kHanyuPinlu
* kHanyuPinyin
* kJapaneseKun
* kJapaneseOn
* kKorean
* kMandarin
* kPhonetic
* kTang
* kTotalStrokes
* kVietnamese
* kXHC1983
17 changes: 17 additions & 0 deletions lib/Lingua/Unihan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,20 @@ sub unihan_query($field_type, $text) is export {
sub unihan_codepoint($text) is export {
return sprintf("%04x", ord Encode::decode('utf-8', buf8.new($text.encode)));
}

=begin pod
=head NAME
Lingua::Unihan - reader (SQLite) for unihan database
=head SYNOPSIS
use Lingua::Unihan;
my $codepoint = unihan_codepoint('你'); # 4f60
my $mandarin = unihan_query('kMandarin', '林'); # 'lín'
my $strokes = unihan_query('kTotalStrokes', '林'); # 8
=end pod

0 comments on commit 3e7143e

Please sign in to comment.