Module: MediaWiktory::Wikipedia::Modules::Contenttranslationcorpora
- Defined in:
- lib/mediawiktory/wikipedia/modules/contenttranslationcorpora.rb
Overview
Get the section-aligned parallel text for a given translation. See also list=cxpublishedtranslations. Dumps are provided in different formats for high volume access.
The "submodule" (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for Actions::Query and its submodules):
api.query # returns Actions::Query
.prop(:revisions) # adds prop=revisions to action URL, and includes Modules::Revisions into action
.limit(10) # method of Modules::Revisions, adds rvlimit=10 to URL
All submodule's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#striphtml ⇒ self
Whether to strip all HTML tags to return plaintext.
-
#translationid(value) ⇒ self
ID of the translation.
-
#types(*values) ⇒ self
By default you will get all three of following if available: source text, machine translation and the postedited translation by the user.
Instance Method Details
#striphtml ⇒ self
Whether to strip all HTML tags to return plaintext.
32 33 34 |
# File 'lib/mediawiktory/wikipedia/modules/contenttranslationcorpora.rb', line 32 def striphtml() merge(striphtml: 'true') end |
#translationid(value) ⇒ self
ID of the translation.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/contenttranslationcorpora.rb', line 25 def translationid(value) merge(translationid: value.to_s) end |
#types(*values) ⇒ self
By default you will get all three of following if available: source text, machine translation and the postedited translation by the user. This parameter allows you not return some of these types.
40 41 42 |
# File 'lib/mediawiktory/wikipedia/modules/contenttranslationcorpora.rb', line 40 def types(*values) values.inject(self) { |res, val| res._types(val) or fail ArgumentError, "Unknown value for types: #{val}" } end |