Extension:Josa: Difference between revisions

From mediawiki.org
Content deleted Content added
m →‎Usage: AWB:, replaced: {{translation}} → {{#translation:}}
I make a mistake
(10 intermediate revisions by the same user not shown)
Line 33: Line 33:
== Usage == <!--T:4-->
== Usage == <!--T:4-->
</translate>
</translate>
<code><nowiki>{{#은는: 한글}}</nowiki></code>
* <code><nowiki>{{</nowiki>'''#functionname''': word }}</code>
*<code><nowiki>{{</nowiki>'''#functionname''': word | ''argument''<nowiki> }}</nowiki></code>
Output: <code>한글은</code>
*<code><nowiki>{{</nowiki>'''#functionname''': word | ''argument 1'' | ''argument 2''<nowiki> }}</nowiki></code> {{MW version-inline|1.30+}}


=== Function names ===
<code><nowiki>{{#은는: 한글|0}}</nowiki></code>
The function will be one of below:
Output: <code>은</code>
{| class="wikitable"
! English and other languages || Korean
|-
| EulRuel || 을를
|-
| EunNeun || 은는
|-
| EGa || 이가
|-
| GwaWa || 과와
|-
| AYa || 아야
|-
| Euro || 으로
|-
| E || 이
|}


A Josa function call without any option will be rendered to the word and a josa. Some special characters are automatically ignored.
<code><nowiki>{{#을를: 위키백과}}</nowiki></code>
* <code><nowiki>{{#EunNeun: 한글}}</nowiki></code> → '''한글은'''
Output: <code>위키백과를</code>
* <code><nowiki>{{#EulRuel: 위키백과}}</nowiki></code> → '''위키백과를'''
* <code><nowiki>{{#EGa: '비타민'}}</nowiki></code> → '''<nowiki>'</nowiki>비타민'이'''
* <code><nowiki>{{#과와: 미디어위키}}</nowiki></code> → '''미디어위키와'''
* <code><nowiki>{{#아야: 지원}}</nowiki></code> → '''지원아'''
* <code><nowiki>{{#이: 정민}}가</nowiki></code> → '''정민이가'''
* <code><nowiki>{{#으로: [[학업]]}}</nowiki></code> → '''[[학업]]으로'''
* <code><nowiki>{{#으로: 100%}}</nowiki></code> → '''100%이'''
* <code><nowiki>{{#EulRuel: 글자 Ñ}}</nowiki></code> → '''글자 Ñ를'''


It is OK that the case in given word is written in English alphabet or ends with a number.
<code><nowiki>{{#이가: 비타민}}</nowiki></code>
* <code><nowiki>{{#EulRuel: DNA}}</nowiki></code> → '''DNA를'''
Output: <code>비타민이</code>
* <code><nowiki>{{#EunNeun: ATM}}</nowiki></code> → '''ATM은'''
* <code><nowiki>{{#Euro: 119}}</nowiki></code> → '''119로'''


But other letters will remains parenthesis:
<code><nowiki>{{#과와: 미디어위키}}</nowiki></code>
* <code><nowiki>{{#EulRuel: 직원(3명)}}</nowiki></code> → '''직원(3명)을(를)'''
Output: <code>미디어위키와</code>


Sometimes results a bug:
<code><nowiki>{{#아야: 철수}}</nowiki></code>
* <code><nowiki>{{#EulRuel: 國語}}</nowiki></code> → '''國語을'''
Output: <code>철수야</code>


=== Arguments ===
<code><nowiki>{{#이: 태준}}가</nowiki></code>

Output: <code>태준이가</code>
==== MediaWiki 1.30 or later ====

Argument must be one of those:

{| class="wikitable"
! Argument || Alias || Description
|-
| <code>josaonly</code> || <code>조사만</code> || Just render a Josa, the given word will be removed. <code><nowiki>{{#EunNeun: 한글|josaonly}}</nowiki></code> → '''은'''
|-
| <code>override=''foo''</code> || <code>덮어쓰기</code>, <code>오버라이드</code> || Replace the Josa with the given text. <code><nowiki>{{#EulRuel:시약 100g|override=을}}</nowiki></code> → '''시약 100g을'''
|}
The order of the arguments is not matter.

==== MediaWiki 1.29 or earlier ====
If second argument is <code>0</code>, the base word will be removed.

* <code><nowiki>{{#EulRuel: 한글|0}}</nowiki></code> → '''을'''

Any other argument makes base word remain. Technically, [[wikipedia:PHP|PHP]] determines whether the value is <code>true</code> or not. So <code>'false'</code> is <code>true</code>, See more examples:

* <code><nowiki>{{#EulRuel: 한글|false}}</nowiki></code> → '''한글을'''
* <code><nowiki>{{#EulRuel: 한글|true}}</nowiki></code> → '''한글을'''
* <code><nowiki>{{#EulRuel: 한글|1}}</nowiki></code> → '''한글을'''<br />


<code><nowiki>{{#으로: 학업}}</nowiki></code>
Output: <code>학업으로</code>


{{TNT|OnWikimedia}}
{{TNT|OnWikimedia}}

Revision as of 06:47, 17 October 2018

MediaWiki extensions manual
Josa
Release status: stable
Implementation Parser function
Description Automates josa part of Korean postposition process.
Author(s) Bae Junehyeon (*devunttalk)
Latest version 0.1 (2014-01-29)
MediaWiki >= 1.42
PHP 5.4+
Database changes No
License MIT License
Download
Example {{#은는:한글}} -> 한글은
Quarterly downloads 4 (Ranked 143rd)
Translate the Josa extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

The Josa extension automates josa (it's pronounced as /dʒo:sa/ or /ʨo:sa/) part of Korean postposition process.

Installation

  • Download and move the extracted Josa folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Josa
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Josa' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

  • {{#functionname: word }}
  • {{#functionname: word | argument }}
  • {{#functionname: word | argument 1 | argument 2 }} 1.30+

Function names

The function will be one of below:

English and other languages Korean
EulRuel 을를
EunNeun 은는
EGa 이가
GwaWa 과와
AYa 아야
Euro 으로
E

A Josa function call without any option will be rendered to the word and a josa. Some special characters are automatically ignored.

  • {{#EunNeun: 한글}}한글은
  • {{#EulRuel: 위키백과}}위키백과를
  • {{#EGa: '비타민'}}'비타민'이
  • {{#과와: 미디어위키}}미디어위키와
  • {{#아야: 지원}}지원아
  • {{#이: 정민}}가정민이가
  • {{#으로: [[학업]]}}학업으로
  • {{#으로: 100%}}100%이
  • {{#EulRuel: 글자 Ñ}}글자 Ñ를

It is OK that the case in given word is written in English alphabet or ends with a number.

  • {{#EulRuel: DNA}}DNA를
  • {{#EunNeun: ATM}}ATM은
  • {{#Euro: 119}}119로

But other letters will remains parenthesis:

  • {{#EulRuel: 직원(3명)}}직원(3명)을(를)

Sometimes results a bug:

  • {{#EulRuel: 國語}}國語을

Arguments

MediaWiki 1.30 or later

Argument must be one of those:

Argument Alias Description
josaonly 조사만 Just render a Josa, the given word will be removed. {{#EunNeun: 한글|josaonly}}
override=foo 덮어쓰기, 오버라이드 Replace the Josa with the given text. {{#EulRuel:시약 100g|override=을}}시약 100g을

The order of the arguments is not matter.

MediaWiki 1.29 or earlier

If second argument is 0, the base word will be removed.

  • {{#EulRuel: 한글|0}}

Any other argument makes base word remain. Technically, PHP determines whether the value is true or not. So 'false' is true, See more examples:

  • {{#EulRuel: 한글|false}}한글을
  • {{#EulRuel: 한글|true}}한글을
  • {{#EulRuel: 한글|1}}한글을