devunt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/217276
Change subject: Fix documentation and styles
......................................................................
Fix documentation and styles
* Also change variable $chr to $code in Josa::getJosa
Change-Id: Ifafd2049fd847511a2b26c43feb856792a628260
---
M Josa.class.php
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Josa
refs/changes/76/217276/1
diff --git a/Josa.class.php b/Josa.class.php
index 91adf1a..c7486c8 100644
--- a/Josa.class.php
+++ b/Josa.class.php
@@ -36,21 +36,21 @@
}
/*
- * @param string $type Type of last letter in word (see
Josa::$josaMap's keys)
- * @param string $str Word to determine josa
+ * @param string $type Type of the last letter in the word (see
Josa::$josaMap's keys)
+ * @param string $str Word to determine the josa
* @return string Josa
*/
public static function getJosa( $type, $str ) {
if ( mb_substr( $str, -2, 2, 'utf-8' ) == ']]' ) { # if end
with internel link
$str = mb_substr( $str, 0, -2, 'utf-8' );
}
- $chr = self::convertToJohabCode( mb_substr( $str, -1, 1,
'utf-8' ) );
- if ( !$chr ) {
+ $code = self::convertToJohabCode( mb_substr( $str, -1, 1,
'utf-8' ) );
+ if ( !$code ) {
$idx = 2; # Not hangul
- } elseif ( ( $chr - 0xAC00 ) % 28 == 0 ) {
+ } elseif ( ( $code - 0xAC00 ) % 28 == 0 ) {
$idx = 1; # No trailing consonant
- } elseif ( ( $type === 'Euro/Ro' ) && ( ( $chr - 0xAC00 ) % 28
== 8 ) ) {
- $idx = 1; # $type is Euro/Ro and trailing consonant is
rieul(ㄹ). This is exception on Korean postposition rules.
+ } elseif ( ( $type === 'Euro/Ro' ) && ( ( $code - 0xAC00 ) % 28
== 8 ) ) {
+ $idx = 1; # $type is Euro/Ro and trailing consonant is
rieul(ㄹ). This is an exception on Korean postposition rules.
} else {
$idx = 0; # Trailing consonant exists
}
--
To view, visit https://gerrit.wikimedia.org/r/217276
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifafd2049fd847511a2b26c43feb856792a628260
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Josa
Gerrit-Branch: master
Gerrit-Owner: devunt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits