nidhal baccouri commited on
Commit
68aa657
·
1 Parent(s): 1e8da0a

fixed readme rst

Browse files
docs/README.rst CHANGED
@@ -306,7 +306,7 @@ Mymemory Translator
306
  translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
307
 
308
 
309
- DeeplTranslator Translator
310
  -----------------
311
 
312
  .. note::
@@ -336,7 +336,7 @@ DeeplTranslator Translator
336
  # the translate_sentences function is deprecated, use the translate_batch function instead
337
  translated = DeeplTranslator("your_api_key").translate_batch(texts)
338
 
339
- QcriTranslator Translator
340
  --------------------
341
 
342
  .. note::
@@ -657,9 +657,8 @@ You can always help the development of this project by:
657
  - Create issues and pull requests
658
  - Sponsor the project
659
 
660
- ==========
661
  Next Steps
662
- ==========
663
 
664
  Take a look in the examples folder for more :)
665
  Contributions are always welcome.
 
306
  translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
307
 
308
 
309
+ DeeplTranslator
310
  -----------------
311
 
312
  .. note::
 
336
  # the translate_sentences function is deprecated, use the translate_batch function instead
337
  translated = DeeplTranslator("your_api_key").translate_batch(texts)
338
 
339
+ QcriTranslator
340
  --------------------
341
 
342
  .. note::
 
657
  - Create issues and pull requests
658
  - Sponsor the project
659
 
 
660
  Next Steps
661
+ ===========
662
 
663
  Take a look in the examples folder for more :)
664
  Contributions are always welcome.
docs/deep_translator.rst CHANGED
@@ -4,6 +4,22 @@ deep\_translator package
4
  Submodules
5
  ----------
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  deep\_translator.constants module
8
  ---------------------------------
9
 
@@ -28,6 +44,14 @@ deep\_translator.detection module
28
  :undoc-members:
29
  :show-inheritance:
30
 
 
 
 
 
 
 
 
 
31
  deep\_translator.exceptions module
32
  ----------------------------------
33
 
@@ -36,10 +60,10 @@ deep\_translator.exceptions module
36
  :undoc-members:
37
  :show-inheritance:
38
 
39
- deep\_translator.google\_trans module
40
- -------------------------------------
41
 
42
- .. automodule:: deep_translator.google_trans
43
  :members:
44
  :undoc-members:
45
  :show-inheritance:
@@ -60,14 +84,6 @@ deep\_translator.linguee module
60
  :undoc-members:
61
  :show-inheritance:
62
 
63
- deep\_translator.main module
64
- ----------------------------
65
-
66
- .. automodule:: deep_translator.main
67
- :members:
68
- :undoc-members:
69
- :show-inheritance:
70
-
71
  deep\_translator.microsoft module
72
  ---------------------------------
73
 
@@ -92,14 +108,6 @@ deep\_translator.papago module
92
  :undoc-members:
93
  :show-inheritance:
94
 
95
- deep\_translator.parent module
96
- ------------------------------
97
-
98
- .. automodule:: deep_translator.parent
99
- :members:
100
- :undoc-members:
101
- :show-inheritance:
102
-
103
  deep\_translator.pons module
104
  ----------------------------
105
 
@@ -116,6 +124,14 @@ deep\_translator.qcri module
116
  :undoc-members:
117
  :show-inheritance:
118
 
 
 
 
 
 
 
 
 
119
  deep\_translator.yandex module
120
  ------------------------------
121
 
 
4
  Submodules
5
  ----------
6
 
7
+ deep\_translator.base module
8
+ ----------------------------
9
+
10
+ .. automodule:: deep_translator.base
11
+ :members:
12
+ :undoc-members:
13
+ :show-inheritance:
14
+
15
+ deep\_translator.cli module
16
+ ---------------------------
17
+
18
+ .. automodule:: deep_translator.cli
19
+ :members:
20
+ :undoc-members:
21
+ :show-inheritance:
22
+
23
  deep\_translator.constants module
24
  ---------------------------------
25
 
 
44
  :undoc-members:
45
  :show-inheritance:
46
 
47
+ deep\_translator.engines module
48
+ -------------------------------
49
+
50
+ .. automodule:: deep_translator.engines
51
+ :members:
52
+ :undoc-members:
53
+ :show-inheritance:
54
+
55
  deep\_translator.exceptions module
56
  ----------------------------------
57
 
 
60
  :undoc-members:
61
  :show-inheritance:
62
 
63
+ deep\_translator.google module
64
+ ------------------------------
65
 
66
+ .. automodule:: deep_translator.google
67
  :members:
68
  :undoc-members:
69
  :show-inheritance:
 
84
  :undoc-members:
85
  :show-inheritance:
86
 
 
 
 
 
 
 
 
 
87
  deep\_translator.microsoft module
88
  ---------------------------------
89
 
 
108
  :undoc-members:
109
  :show-inheritance:
110
 
 
 
 
 
 
 
 
 
111
  deep\_translator.pons module
112
  ----------------------------
113
 
 
124
  :undoc-members:
125
  :show-inheritance:
126
 
127
+ deep\_translator.validate module
128
+ --------------------------------
129
+
130
+ .. automodule:: deep_translator.validate
131
+ :members:
132
+ :undoc-members:
133
+ :show-inheritance:
134
+
135
  deep\_translator.yandex module
136
  ------------------------------
137
 
docs/deep_translator.tests.rst DELETED
@@ -1,69 +0,0 @@
1
- deep\_translator.tests package
2
- ==============================
3
-
4
- Submodules
5
- ----------
6
-
7
- deep\_translator.tests.test\_cli module
8
- ---------------------------------------
9
-
10
- .. automodule:: deep_translator.tests.test_cli
11
- :members:
12
- :undoc-members:
13
- :show-inheritance:
14
-
15
- deep\_translator.tests.test\_deepl module
16
- -----------------------------------------
17
-
18
- .. automodule:: deep_translator.tests.test_deepl
19
- :members:
20
- :undoc-members:
21
- :show-inheritance:
22
-
23
- deep\_translator.tests.test\_google\_trans module
24
- -------------------------------------------------
25
-
26
- .. automodule:: deep_translator.tests.test_google_trans
27
- :members:
28
- :undoc-members:
29
- :show-inheritance:
30
-
31
- deep\_translator.tests.test\_linguee module
32
- -------------------------------------------
33
-
34
- .. automodule:: deep_translator.tests.test_linguee
35
- :members:
36
- :undoc-members:
37
- :show-inheritance:
38
-
39
- deep\_translator.tests.test\_microsoft\_trans module
40
- ----------------------------------------------------
41
-
42
- .. automodule:: deep_translator.tests.test_microsoft_trans
43
- :members:
44
- :undoc-members:
45
- :show-inheritance:
46
-
47
- deep\_translator.tests.test\_mymemory module
48
- --------------------------------------------
49
-
50
- .. automodule:: deep_translator.tests.test_mymemory
51
- :members:
52
- :undoc-members:
53
- :show-inheritance:
54
-
55
- deep\_translator.tests.test\_pons module
56
- ----------------------------------------
57
-
58
- .. automodule:: deep_translator.tests.test_pons
59
- :members:
60
- :undoc-members:
61
- :show-inheritance:
62
-
63
- Module contents
64
- ---------------
65
-
66
- .. automodule:: deep_translator.tests
67
- :members:
68
- :undoc-members:
69
- :show-inheritance:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/index.rst CHANGED
@@ -2,8 +2,6 @@
2
  Welcome to deep_translator's documentation!
3
  ===========================================
4
 
5
- If you see this doc in other languages,you can see :doc:`Choose languages</other_lang>`.
6
-
7
  .. toctree::
8
  :maxdepth: 2
9
  :caption: Contents:
@@ -16,12 +14,6 @@ If you see this doc in other languages,you can see :doc:`Choose languages</other
16
  contributing
17
  authors
18
  history
19
- other_lang
20
-
21
- .. toctree::
22
- :hidden:
23
-
24
- ./ja/index
25
 
26
  Indices and tables
27
  ==================
 
2
  Welcome to deep_translator's documentation!
3
  ===========================================
4
 
 
 
5
  .. toctree::
6
  :maxdepth: 2
7
  :caption: Contents:
 
14
  contributing
15
  authors
16
  history
 
 
 
 
 
 
17
 
18
  Indices and tables
19
  ==================
docs/ja/README.rst DELETED
@@ -1,349 +0,0 @@
1
- ****************
2
- deep_translator
3
- ****************
4
-
5
-
6
- .. image:: https://img.shields.io/pypi/v/deep_translator.svg
7
- :target: https://pypi.python.org/pypi/deep_translator
8
- .. image:: https://img.shields.io/travis/nidhaloff/deep_translator.svg
9
- :target: https://travis-ci.com/nidhaloff/deep_translator
10
- .. image:: https://readthedocs.org/projects/deep-translator/badge/?version=latest
11
- :target: https://deep-translator.readthedocs.io/en/latest/?badge=latest
12
- :alt: Documentation Status
13
- .. image:: https://img.shields.io/pypi/l/deep-translator
14
- :target: https://pypi.python.org/pypi/deep_translator
15
-
16
- .. image:: https://img.shields.io/pypi/dm/deep-translator
17
- :target: https://pypi.python.org/pypi/deep_translator
18
- .. image:: https://img.shields.io/pypi/status/deep-translator
19
- :target: https://pypi.python.org/pypi/deep_translator
20
- .. image:: https://img.shields.io/pypi/wheel/deep-translator
21
- :target: https://pypi.python.org/pypi/deep_translator
22
-
23
- .. image:: https://img.shields.io/github/last-commit/nidhaloff/gpx_converter
24
- :alt: GitHub last commit
25
- :target: https://pypi.python.org/pypi/deep_translator
26
-
27
- .. image:: https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2FNidhalBaccouri
28
- :alt: Twitter URL
29
- :target: https://twitter.com/NidhalBaccouri
30
-
31
- .. image:: https://img.shields.io/badge/$-buy%20me%20a%20coffee-ff69b4.svg?style=social
32
- :target: https://www.buymeacoffee.com/nidhaloff?new=1
33
-
34
-
35
- =======================
36
- 自然言語の翻訳ツール
37
- =======================
38
-
39
- 複数の翻訳サービスを使って、簡単な方法で異なる言語間で柔軟に翻訳を **無料** かつ **無制限** に行えるツールです
40
-
41
- * フリーソフトウェア: MIT ライセンス
42
- * ドキュメント: https://deep-translator.readthedocs.io.
43
-
44
- ==========
45
- 開発の動機
46
- ==========
47
-
48
- Pythonを使用してテキストを別の言語に翻訳するタスクがありました。しかし、それを行う簡単な方法を見つけるのは困難でした。なぜなら、このタスクに適用できるライブラリはいくつか存在しますが、それらのほとんどはバグが多いか、無料ではないか、何らかの制約があるか、全ての言語をサポートしていないか、使用するのが簡単ではありませんでした。
49
-
50
- そこで、このタスクを簡単に行えるツールを作成することにしました。100%無料で無制限で使いやすく、すべての言語をサポートしています。
51
-
52
- このツールの目的は、複数の有名な翻訳サービスをこのツールに統合することにあります。
53
-
54
-
55
- ======================
56
- 使用例
57
- ======================
58
-
59
- - Pythonを使用してテキストを翻訳したい場合
60
- - ファイルのテキストを翻訳したい場合
61
- - 1つだけでなく、多くのソースから翻訳結果を取得したい場合
62
- - 翻訳を自動化したい場合
63
- - 異なる翻訳結果を比較したい場合
64
- - 言語を自動検出したい場合
65
-
66
- ======================
67
- このツールの強み
68
- ======================
69
-
70
- - 高度な抽象化が施されている
71
- - 言語を自動で検出する
72
- - 拡張と使用が簡単である
73
- - 多くの翻訳サービスを統合して扱える唯一のpythonツールである
74
- - 安定している
75
- - 有名な翻訳サービスをサポートしている
76
-
77
- ========
78
- 機能
79
- ========
80
-
81
- * google翻訳のサポート
82
- * Pons (pons.com)のサポート
83
- * Linguee のサポート
84
- * Mymemory のサポート
85
- * 自動言語検出
86
- * テキストファイルから直接翻訳する
87
- * 単語の複数の翻訳結果を取得する
88
- * 異なる言語の異なる段落の翻訳を自動化する
89
- * コマンドラインから直接翻訳する(バージョン1.1.0以上)
90
-
91
- ===============
92
- インストール方法
93
- ===============
94
-
95
- ツールの安定版をインストールする方法です:
96
-
97
- .. code-block:: console
98
-
99
- $ pip install -U deep_translator
100
-
101
- ソースからインストールを行いたい場合、ドキュメントを参照してください。
102
-
103
- =======
104
- 使い方
105
- =======
106
-
107
- このセクションでは、このツールで様々な統合トランスレータを利用するデモを行います。このデモでは、google、pons、linguee、mymemoryの翻訳サービスを扱います(現時点)。将来的には、より多くの翻訳サービスを統合する予定です。
108
-
109
- ==========
110
- インポート
111
- ==========
112
-
113
- .. code-block:: python
114
-
115
- from deep_translator import (GoogleTranslator,
116
- PonsTranslator,
117
- LingueeTranslator,
118
- MyMemoryTranslator,
119
- detect_language)
120
-
121
-
122
- サポートされている言語を確認する
123
- ============================
124
-
125
- ポイント
126
-
127
-  関数get_supported_languagesを静的メソッドとして呼び出すことにより、各翻訳サービスでサポートしている言語を確認できます。
128
-
129
- .. code-block:: python
130
-
131
- # デフォルトではリストを返します
132
- langs_list = GoogleTranslator.get_supported_languages() # output: [arabic, french, english etc...]
133
-
134
- # 言語の省略形を辞書型にまとめて返すことも出来ます
135
- langs_dict = GoogleTranslator.get_supported_languages(as_dict=True) # output: {arabic: ar, french: fr, english:en etc...}
136
-
137
- 言語検出
138
- ===================
139
-
140
- ポイント
141
-
142
- 言語を自動的に検出することもできます。当然、このパッケージは無料です。言語検出機能を無料で使用する場合は、個人でapi_keyを取得する必要があります。ここで無料で入手することができます:https://detectlanguage.com/documentation
143
-
144
- .. code-block:: python
145
-
146
- lang = detect_language('bonjour la vie', api_key='your_api_key')
147
- print(lang) # output: fr
148
-
149
-
150
- Google 翻訳
151
- =================
152
-
153
- .. code-block:: python
154
-
155
- text = 'happy coding'
156
-
157
- - ソースの言語に自動検出を使用できます:
158
-
159
- .. code-block:: python
160
-
161
- translated = GoogleTranslator(source='auto', target='german').translate(text=text)
162
-
163
- - ソースの言語の種類を指定することも出来ます:
164
-
165
- .. code-block:: python
166
-
167
- translated = GoogleTranslator(source='english', target='german').translate(text=text)
168
-
169
- - 言語名は省略形で指定することも可能です:
170
-
171
- .. code-block:: python
172
-
173
- translated = GoogleTranslator(source='en', target='de').translate(text=text)
174
-
175
- - ファイルから翻訳を行うことも出来ます:
176
-
177
- .. code-block:: python
178
-
179
- translated = GoogleTranslator(source='auto', target='german').translate_file('path/to/file')
180
-
181
-
182
- - ソースの言語を検出し、望んだ言語に自動翻訳することが出来ます。
183
-
184
- .. code-block:: python
185
-
186
- # または、異なる言語の文章の翻訳を自動化したい時にも利用できます。
187
- translated = GoogleTranslator(source='auto', target='de').translate_sentences([your_list_of_sentences])
188
-
189
-
190
-
191
-
192
- PONS
193
- ===============
194
-
195
- ポイント
196
-
197
- Google翻訳同様に言語の名前を指定して翻訳することが出来ます。省略形で指定することも可能です。
198
-
199
- .. code-block:: python
200
-
201
- word = 'awesome'
202
-
203
- - 簡単な翻訳方法
204
-
205
- .. code-block:: python
206
-
207
- translated_word = PonsTranslator(source='english', target='french').translate(word)
208
-
209
- # 言語の省略形を指定する
210
- translated_word = PonsTranslator(source='en', target='fr').translate(word)
211
-
212
-
213
- - 全ての同義語か一致する単語を返す
214
-
215
- .. code-block:: python
216
-
217
- # 翻訳結果の全ての同義語を取得したい場合、引数にreturn_allにTrueを指定してください
218
- translated_word = LingueeTranslator(source='english', target='french').translate(word, return_all=True)
219
-
220
-
221
-
222
- Linguee
223
- ===================
224
-
225
-
226
- .. code-block:: python
227
-
228
- word = 'good'
229
-
230
- - 簡単な翻訳方法
231
-
232
- .. code-block:: python
233
-
234
- translated_word = LingueeTranslator(source='english', target='french').translate(word)
235
-
236
- # 言語の省略形を指定する
237
- translated_word = LingueeTranslator(source='en', target='fr').translate(word)
238
-
239
- - 全ての同義語か一致する単語を返す
240
-
241
- .. code-block:: python
242
-
243
- # 翻訳結果の全ての同義語を取得したい場合、引数にreturn_allにTrueを指定してください
244
- translated_word = LingueeTranslator(source='english', target='french').translate(word, return_all=True)
245
-
246
-
247
- Mymemory
248
- ====================
249
-
250
- ポイント
251
-
252
- sourceに"auto"を渡すことでmymemoryの自動言語検出を使用できます。
253
-
254
- .. code-block:: python
255
-
256
- text = 'Keep it up. You are awesome'
257
-
258
- translated = MyMemoryTranslator(source='auto', target='french').translate(text)
259
-
260
- ターミナルでの使用方法
261
- ====================
262
-
263
-
264
- ターミナルからdeep_translatorをすぐに使用できます。使用するには、使用する翻訳サービス、翻訳元の言語、翻訳先の言語、翻訳するテキストなどを引数に指定する必要があります。
265
- たとえば、Google翻訳を使用するには、引数として「google」を指定します。引数を変更することで、サポートされている他の翻訳サービスに切り替えることも可能です。ドキュメントを読んで、このツールでサポートされている翻訳サービスを確認してください。
266
-
267
-
268
- .. code-block:: console
269
-
270
- $ deep_translator --translator "google" --source "english" --target "german" --text "happy coding"
271
-
272
- 以下のように短く記述することもできます:
273
-
274
- .. code-block:: console
275
-
276
- $ deep_translator -trans "google" -src "english" -tg "german" -txt "happy coding"
277
-
278
-
279
- 翻訳元と翻訳先の言語を省略形で引数に指定することも出来ます。
280
-
281
- .. code-block:: console
282
-
283
- $ deep_translator -trans "google" -src "en" -tg "de" -txt "happy coding"
284
-
285
-
286
- ヒント
287
- ==========
288
-
289
- 一般��に、google翻訳とmymemoryは文章に翻訳に適していますが、ponsとlingueeは単語の翻訳に適しています。
290
-
291
- ========
292
- リンク
293
- ========
294
-
295
- deep_translatorの使用目的やpythonで翻訳をする方法を確認するために以下のmediumの記事を確認してください。
296
-
297
- https://medium.com/@nidhalbacc/how-to-translate-text-with-python-9d203139dcf5
298
-
299
- ===============================
300
- スマートフォンアプリ Translator++
301
- ===============================
302
-
303
- .. image:: ../../assets/app-icon.png
304
- :width: 100
305
- :alt: Icon of the app
306
-
307
-
308
- deep_translatorを開発しみて、スマートフォンのアプリとして使用できれば便利なのではないかと思い立ちました。
309
- google翻訳やpons、lingueeの個々のアプリは存在しますが、これらを統合して使用できるアプリを作れば便利ではないでしょうか。
310
-
311
- それを出発点として、アプリの開発を開始しました。Pythonで作成しつつ、クロスプラットフォームのアプリを開発したかったので、`kivy フレームワーク <https://kivy.org/#home/>`_ を使用することにしました。
312
- `Translator++ app <https://github.com/nidhaloff/deep-translator-app/>`_ もgithubでオープンソースとして公開しています。自由に編集やプルリクエストを行ってください;)
313
-
314
- ポイント
315
-
316
- Translator++はdeep_translatorパッケージがベースになっています。このアプリはパッケージの機能を試すために開発されています。
317
-
318
- 02-08-2020にGoogle Playで初公開されました。
319
-
320
- スクリーンショット:
321
-
322
- - スマートフォン :
323
-
324
- .. image:: ../../assets/translator1.jpg
325
- :width: 30%
326
- :height: 200
327
- :alt: screenshot1
328
- .. image:: ../../assets/translator2.jpg
329
- :width: 30%
330
- :height: 200
331
- :alt: screenshot2
332
- .. image:: ../../assets/spinner.jpg
333
- :width: 30%
334
- :height: 200
335
- :alt: spinner
336
-
337
- - タブレット:
338
-
339
- .. image:: ../../assets/hz_view.png
340
- :width: 100%
341
- :height: 300
342
- :alt: screenshot3
343
-
344
- =======================
345
- 次のステップに進むためには
346
- =======================
347
-
348
- 詳細は examples フォルダを確認してください。
349
- コントリビュートはいつでも歓迎しています。このパッケージが便利だと感じた方や使っている方がいたら、遠慮なくプルリクエストをしてフィードバックをください!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/ja/authors.rst DELETED
@@ -1,15 +0,0 @@
1
- =============
2
- クレジット
3
- =============
4
-
5
- 開発リーダー
6
- --------------------------------
7
-
8
- * Nidhal Baccouri <[email protected]>
9
-
10
- 寄稿者
11
- ------------
12
-
13
- @prataffel
14
- @ senk8
15
- @ nothead31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/ja/index.rst DELETED
@@ -1,24 +0,0 @@
1
- .. _jadoc:
2
-
3
- deep_translatorのドキュメントへようこそ!
4
- ===================================================
5
-
6
- 違う言語でドキュメントを読みたい場合は :doc:`こちら<../other_lang>`.
7
-
8
- .. toctree::
9
- :maxdepth: 2
10
- :caption: Contents:
11
-
12
- README
13
- installation
14
- usage
15
- ../modules
16
- contributing
17
- authors
18
- history
19
-
20
- 目次
21
- ==================
22
- * :ref:`genindex`
23
- * :ref:`modindex`
24
- * :ref:`search`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/ja/installation.rst DELETED
@@ -1,50 +0,0 @@
1
- .. highlight:: shell
2
-
3
- ===============
4
- インストール方法
5
- ===============
6
-
7
-
8
- 安定版
9
- --------------
10
-
11
- deep_translatorをインストールしたい場合、以下のコマンドをターミナルで入力してください:
12
-
13
- .. code-block:: console
14
-
15
- $ pip install deep_translator
16
-
17
- 常に最新の安定版をインストールできるため、deep_translatorはこの方法でインストールすることを推奨します。
18
-
19
- pipがインストールされていない場合は、以下のPythonインストールガイドを参照してください。
20
-
21
- .. _pip: https://pip.pypa.io
22
- .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
23
-
24
-
25
- From sources
26
- ------------
27
-
28
- deep_translatorのソースはGithubのリポジトリからダウンロードできます.
29
-
30
- 公開されているリポジトリのクローンも可能です:
31
-
32
- .. code-block:: console
33
-
34
- $ git clone git://github.com/nidhaloff/deep_translator
35
-
36
- tarballをインストールする場合は以下のようになります:
37
-
38
- .. code-block:: console
39
-
40
- $ curl -OJL https://github.com/nidhaloff/deep_translator/tarball/master
41
-
42
- クローンした後に、以下のコマンドを実行することでインストールが出来ます:
43
-
44
- .. code-block:: console
45
-
46
- $ python setup.py install
47
-
48
-
49
- .. _Github repo: https://github.com/nidhaloff/deep_translator
50
- .. _tarball: https://github.com/nidhaloff/deep_translator/tarball/master
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/ja/usage.rst DELETED
@@ -1,75 +0,0 @@
1
- =======
2
- 使い方
3
- =======
4
-
5
- .. code-block:: python
6
-
7
- from deep_translator import GoogleTranslator, PonsTranslator, LingueeTranslator, MyMemoryTranslator
8
-
9
- english_text = 'happy coding'
10
-
11
- result_german = GoogleTranslator(source='auto', target='de').translate(text=english_text)
12
-
13
- # 言語を名前で指定することもできます:
14
- translated = GoogleTranslator(source='english', target='german').translate(text=english_text)
15
-
16
- # テキストファイルを翻訳したい場合
17
- translated = GoogleTranslator(source='auto', target='german').translate_file('path/to/file')
18
-
19
- # 複数の言語の文章の翻訳を自動化したい場合
20
- translated = GoogleTranslator(source='auto', target='de').translate_sentences(your_list_of_sentences)
21
-
22
-
23
- Ponsを利用することも出来ます: Pons.com
24
-
25
-
26
- .. code-block:: python
27
-
28
- word = 'good'
29
- translated_word = PonsTranslator(source='english', target='french').translate(word)
30
-
31
- # 翻訳する単語の同義語を全て取得したい場合は、return_allにTrueを指定してください。
32
- translated_word = PonsTranslator(source='english', target='french').translate(word, return_all=True)
33
-
34
-
35
- deep_translatorのバージョン1.0.0以上でLingueeをサポートしています:
36
-
37
-
38
- .. code-block:: python
39
-
40
- word = 'good'
41
- translated_word = LingueeTranslator(source='english', target='french').translate(word)
42
-
43
- # 翻訳する単語の同義語を全て取得したい場合は、return_allにTrueを指定してください。
44
- translated_word = LingueeTranslator(source='english', target='french').translate(word, return_all=True)
45
-
46
-
47
- Mymemoryはバージョン1.0.2以上でサポートされています:
48
-
49
- .. code-block:: python
50
-
51
- word = 'good'
52
- translated_word = MyMemoryTranslator(source='english', target='french').translate(word)
53
-
54
-
55
- ターミナルでの使用方法
56
- ====================
57
-
58
- ターミナルからdeep_translatorをすぐに使用できます。使用するには、使用する翻訳サービス、翻訳元の言語、翻訳先の言語、翻訳するテキストなどを引数に指定する必要があります。
59
- たとえば、Google翻訳を使用するには、引数として「google」を指定します。引数を変更することで、サポートされている他の翻訳サービスに切り替えることも可能です。ドキュメントを読んで、このツールでサポートされている翻訳サービスを確認してください。
60
-
61
- .. code-block:: console
62
-
63
- $ deep_translator --translator "google" --source "english" --target "german" --text "happy coding"
64
-
65
- 以下のように短く記述することもできます:
66
-
67
- .. code-block:: console
68
-
69
- $ deep_translator -trans "google" -src "english" -tg "german" -txt "happy coding"
70
-
71
- 翻訳元と翻訳先の言語を省略形で引数に指定することも出来ます。
72
-
73
- .. code-block:: console
74
-
75
- $ deep_translator -trans "google" -src "en" -tg "de" -txt "happy coding"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/modules.rst CHANGED
@@ -1,105 +1,7 @@
1
- deep\_translator package
2
- ========================
3
 
4
- Submodules
5
- ----------
6
 
7
- CLI Module
8
- ----------------------------
9
-
10
- .. automodule:: deep_translator.main
11
- :members:
12
- :undoc-members:
13
- :show-inheritance:
14
-
15
- Exceptions
16
- ----------------------------------
17
-
18
- .. automodule:: deep_translator.exceptions
19
- :members:
20
- :undoc-members:
21
- :show-inheritance:
22
-
23
-
24
- Language Detection Library
25
- ----------------------------------
26
-
27
- .. automodule:: deep_translator.detection
28
- :members:
29
- :undoc-members:
30
- :show-inheritance:
31
-
32
- Translators
33
- ============
34
-
35
- Google Translator
36
- ----------------------------------
37
-
38
- .. automodule:: deep_translator.google_trans
39
- :members:
40
- :undoc-members:
41
- :show-inheritance:
42
-
43
- DeeplTranslator
44
- ----------------------------------
45
-
46
- .. automodule:: deep_translator.deepl
47
- :members:
48
- :undoc-members:
49
- :show-inheritance:
50
-
51
- Linguee
52
- ----------------------------------
53
-
54
- .. automodule:: deep_translator.linguee
55
- :members:
56
- :undoc-members:
57
- :show-inheritance:
58
-
59
- Microsoft/Bing Translate
60
- ----------------------------------
61
-
62
- .. automodule:: deep_translator.microsoft
63
- :members:
64
- :undoc-members:
65
- :show-inheritance:
66
-
67
- MyMemory
68
- ----------------------------------
69
-
70
- .. automodule:: deep_translator.mymemory
71
- :members:
72
- :undoc-members:
73
- :show-inheritance:
74
-
75
- Papago
76
- ----------------------------------
77
-
78
- .. automodule:: deep_translator.papago
79
- :members:
80
- :undoc-members:
81
- :show-inheritance:
82
-
83
- Pons
84
- ----------------------------------
85
-
86
- .. automodule:: deep_translator.pons
87
- :members:
88
- :undoc-members:
89
- :show-inheritance:
90
-
91
- QcriTranslator
92
- ----------------------------------
93
-
94
- .. automodule:: deep_translator.qcri
95
- :members:
96
- :undoc-members:
97
- :show-inheritance:
98
-
99
- Yandex
100
- ----------------------------------
101
-
102
- .. automodule:: deep_translator.yandex
103
- :members:
104
- :undoc-members:
105
- :show-inheritance:
 
1
+ deep_translator
2
+ ===============
3
 
4
+ .. toctree::
5
+ :maxdepth: 4
6
 
7
+ deep_translator
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/other_lang.rst DELETED
@@ -1,10 +0,0 @@
1
- Choose Languages
2
- =================
3
-
4
- English
5
- --------------
6
- :doc:`English Documents<index>`
7
-
8
- 日本語
9
- --------------
10
- :doc:`日本語版ドキュメント<ja/index>`
 
 
 
 
 
 
 
 
 
 
 
docs/usage.rst CHANGED
@@ -44,7 +44,7 @@ Check Supported Languages
44
  langs_dict = GoogleTranslator.get_supported_languages(as_dict=True) # output: {arabic: ar, french: fr, english:en etc...}
45
 
46
  Language Detection
47
- ------------------
48
 
49
  .. note::
50
 
@@ -140,7 +140,7 @@ Mymemory Translator
140
  translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
141
 
142
 
143
- DeeplTranslator Translator
144
  -----------------
145
 
146
  .. note::
@@ -165,7 +165,7 @@ DeeplTranslator Translator
165
  # the translate_sentences function is deprecated, use the translate_batch function instead
166
  translated = DeeplTranslator("your_api_key").translate_batch(texts)
167
 
168
- QcriTranslator Translator
169
  --------------------
170
 
171
  .. note::
 
44
  langs_dict = GoogleTranslator.get_supported_languages(as_dict=True) # output: {arabic: ar, french: fr, english:en etc...}
45
 
46
  Language Detection
47
+ -------------------
48
 
49
  .. note::
50
 
 
140
  translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
141
 
142
 
143
+ DeeplTranslator
144
  -----------------
145
 
146
  .. note::
 
165
  # the translate_sentences function is deprecated, use the translate_batch function instead
166
  translated = DeeplTranslator("your_api_key").translate_batch(texts)
167
 
168
+ QcriTranslator
169
  --------------------
170
 
171
  .. note::