mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -48,8 +48,8 @@ public class SimpleFtpServer {
|
||||
return new SimpleFtpServer();
|
||||
}
|
||||
|
||||
FtpServerFactory serverFactory;
|
||||
ListenerFactory listenerFactory;
|
||||
private final FtpServerFactory serverFactory;
|
||||
private final ListenerFactory listenerFactory;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
|
@@ -37,7 +37,7 @@ public interface PinyinEngine {
|
||||
/**
|
||||
* 获取字符串对应的完整拼音,非中文返回原字符
|
||||
*
|
||||
* @param str 字符串
|
||||
* @param str 字符串
|
||||
* @param separator 拼音之间的分隔符
|
||||
* @return 拼音
|
||||
*/
|
||||
@@ -56,13 +56,13 @@ public interface PinyinEngine {
|
||||
/**
|
||||
* 将输入字符串转为拼音首字母,其它字符原样返回
|
||||
*
|
||||
* @param str 任意字符,汉字返回拼音,非汉字原样返回
|
||||
* @param str 任意字符,汉字返回拼音,非汉字原样返回
|
||||
* @param separator 分隔符
|
||||
* @return 汉字返回拼音,非汉字原样返回
|
||||
*/
|
||||
default String getFirstLetter(final String str, final String separator) {
|
||||
final String splitSeparator = StrUtil.isEmpty(separator) ? "#" : separator;
|
||||
final List<String> split = SplitUtil.split(getPinyin(str, splitSeparator), splitSeparator);
|
||||
return CollUtil.join(split, separator, (s)->String.valueOf(s.length() > 0 ? s.charAt(0) : StrUtil.EMPTY));
|
||||
return CollUtil.join(split, separator, (s) -> String.valueOf(!s.isEmpty() ? s.charAt(0) : StrUtil.EMPTY));
|
||||
}
|
||||
}
|
||||
|
@@ -51,10 +51,4 @@ public class AnsjResult implements Result {
|
||||
public void remove() {
|
||||
result.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Word> iterator() {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user