사망 메시지를 별도로 분리

This commit is contained in:
2018-09-30 02:05:12 +09:00
parent 77c3385f93
commit 432318226e
2 changed files with 152 additions and 0 deletions
+17
View File
@@ -603,4 +603,21 @@ class JosaUtil{
return JosaUtil::put($text, $wJongsung, $woJongsung);
};
}
public static function batch(string $text, string $key, array $decorator =[':',':']){
JosaUtil::init();
$search = [];
$replace = [];
foreach(static::DEFAULT_POSTPOSITION as [$wJong, $woJong]){
$value = JosaUtil::pick($key, $wJong);
$search[] = "{$prefix}{$wJong}{$postfix}";
$replace[] = $value;
$search[] = "{$prefix}{$woJong}{$postfix}";
$replace[] = $value;
}
return str_replace($search, $replace, $text);
}
}