ropencc 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'http://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in ropencc.gemspec
4
4
  gemspec
5
+
6
+ gem "ffi", '~> 1.0'
data/README.md CHANGED
@@ -1,42 +1,60 @@
1
+
1
2
  ropencc
2
3
  =======
3
4
  ropencc is a project for conversion between Traditional and Simplified Chinese, wrapper in ruby.
4
5
 
5
- Open Chinese Convert(OpenCC)「開放中文轉換」,是一個致力於中
6
- 文簡繁轉換的項目,提供高質量詞庫和函數庫(libopencc)。<a href='http://code.google.com/p/opencc/'>更多介紹</a>。
6
+ 繁简转换的程序,看似简单,但一研究起来,却真的不简单。其中一个难点是繁简汉字之间往往不能一一对应
7
+
8
+ 例如:瞭解 -> 了解 瞭望 -> 瞭望;“標準”繁換簡是“标准”,但“标准”簡換繁卻是“標准”
9
+
10
+ 还有若干语言习惯的问题,例如同一个地名的称呼就不一样,就不一一列举了
11
+
12
+ 而 Open Chinese Convert(OpenCC)「开发中文转换」,是一个致力于中
13
+ 文简繁转换的项目,由清华大学的 [BYVoid](http://www.byvoid.com/blog/about/) 提供高质量词库和函数库(libopencc)。<a href='http://code.google.com/p/opencc/'>更多介紹</a>。
7
14
 
8
15
  Install
9
16
  -------
10
- 先安装 libopencc
17
+ 1. 先安装 libopencc
11
18
 
12
- Ubuntu
19
+ Ubuntu
13
20
 
14
- 如果你正在使用Ubuntu 10.10 (Maverick) 以上的版本,opencc已經被加入到了官方源中,使用
21
+ 如果你正在使用Ubuntu 10.10 (Maverick) 以上的版本,opencc已經被加入到了官方源中,使用
15
22
 
16
- sudo apt-get install opencc
23
+ sudo apt-get install opencc
17
24
 
18
- 如果你更願意體驗最新的版本,請使用ppa:
25
+ 如果你更願意體驗最新的版本,請使用ppa:
19
26
 
20
- sudo add-apt-repository ppa:byvoid-kcp/ppa
21
- sudo apt-get update
22
- sudo apt-get install opencc
27
+ sudo add-apt-repository ppa:byvoid-kcp/ppa
28
+ sudo apt-get update
29
+ sudo apt-get install opencc
23
30
 
24
31
 
25
- Mac OS X
32
+ Mac OS X
26
33
 
27
- 使用 brew 安装
34
+ 使用 brew 安装
28
35
 
29
- brew install opencc
36
+ brew install opencc
30
37
 
31
- 更多 libopencc 安装介绍请查看: <http://code.google.com/p/opencc/wiki/Install>
38
+ 更多 libopencc 安装介绍请查看: <http://code.google.com/p/opencc/wiki/Install>
39
+
40
+ 2. 安装 ropencc
41
+
42
+ gem install ropencc
32
43
 
33
44
  Usage
34
45
  -----
35
46
 
36
47
  简转繁
37
48
 
38
- Ropencc.conv('simp_to_trad',text)
49
+ Ropencc.conv('simp_to_trad', str)
39
50
 
40
51
  繁转简
41
52
 
42
- Ropencc.conv('trad_to_simp',text)
53
+ Ropencc.conv('trad_to_simp', str)
54
+
55
+
56
+ 附:libopencc 作者简介
57
+ --------------------
58
+ BYVoid,清華大學計算機系二零一零級本科生,清華大學學生網絡管理委員會副會長,現於微軟亞洲研究院系統組實習。
59
+
60
+ 出生於1991年末,年十九歲,河南安陽人。熱愛計算機科學、語言學、漢語音韻學。能說有入聲的老派安陽話,會用簡繁體流暢地閱讀書寫,能夠辨析漢字簡繁正異用法。認爲「正體字」不等於「臺灣正體字」,支持傳統正體字回歸主流,主張廢除簡體字, 希望陸、港、澳、臺、日、韓、越早日實現漢字統一。
data/lib/ropencc.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ # -*- encoding: utf-8 -*-
2
2
  require 'ffi'
3
3
  require "ropencc/version"
4
4
 
@@ -1,3 +1,3 @@
1
1
  module Ropencc
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/ropencc.gemspec CHANGED
@@ -8,6 +8,8 @@ Gem::Specification.new do |gem|
8
8
  gem.summary = %q{ a project for conversion between Traditional and Simplified Chinese. }
9
9
  gem.homepage = "https://github.com/Psli/ropencc"
10
10
 
11
+ gem.add_dependency 'ffi', '~> 1.0'
12
+
11
13
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
14
  gem.files = `git ls-files`.split("\n")
13
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ropencc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,18 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2011-11-27 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ffi
16
+ requirement: &2156708560 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2156708560
14
25
  description: ! ' a project for conversion between Traditional and Simplified Chinese,
15
26
  wrapper in ruby. '
16
27
  email:
@@ -46,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
57
  version: '0'
47
58
  requirements: []
48
59
  rubyforge_project:
49
- rubygems_version: 1.8.10
60
+ rubygems_version: 1.8.11
50
61
  signing_key:
51
62
  specification_version: 3
52
63
  summary: a project for conversion between Traditional and Simplified Chinese.