Tag: 中文预览模式: 普通 | 列表
09-09
18

判斷輸入的字串中,中英文判別

要判斷中文得先知道中文 unicode 的 range,
希望下面例子對你有幫助

public class Test{
public static void main(String[] args) {
String test = "Is This 123 中文 or 不是";
System.out.print("char\t");
System.out.print("unicode\t");
System.out.println("hex\t");

查看更多...

Tags: 英文 中文 判断

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 240
09-08
29

当前几个主要的Lucene中文分词器的比较

原文见:http://blog.fulin.org/2009/08/lucene_chinese_analyzer_compare.html,更多讨论请去原文处。

1. 基本介绍:

paoding :Lucene中文分词“庖丁解牛” Paoding Analysis
imdict :imdict智能词典所采用的智能中文分词程序
mmseg4j : 用 Chih-Hao Tsai 的 MMSeg 算法 实现的中文分词器
ik :采用了特有的“正向迭代最细粒度切分算法“,多子处理器分析模式

查看更多...

Tags: 中文 分词

分类:Seo&Hacker | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 386
09-04
06

Java判断中文的方法

1、
  int count = 0;
  String regEx = "[\\u4e00-\\u9fa5]";
  // System.out.println(regEx);
  String str = "字符串";
  // System.out.println(str);
  Pattern p = Pattern.compile(regEx);
  Matcher m = p.matcher(str);
  System.out.print("提取出来的中文有:");

查看更多...

Tags: 中文

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 400
08-05
13

UTF-8导入MYSQL中文无显示

   今天把本地的MYSQL数据导出到web service,结果发现中文字符全不见了。配置如下:
  导出数据库5.0.45。字符集:UTF-8
    导入数据库数据库5.0.22,也是UTF-8

   结果发现是phpadmin版本不兼容,以至于导出数据出现问题,使用mysqldump指令进行导出。
  
mysqldump -uroot -p123456 thfxw>d:\ym.sql

查看更多...

Tags: 中文 无显示 UTF-8

分类:Database | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 758
MyEclipse中新建一个MessageBundle.properties文件,如果输入中文保存时就会提示错误:
Save could not be completed.
Reason:
some characters cannot be mapped using "ISO-8859-1" character encoding.
Either change the encoding or remove the characters which are not supported
by the "ISO-8859-1" character encoding.

引用内容 引用内容
解决办法:
打开Eclipse的Preferences,选择General->Content Types,然后修改右面的Text下的Java Properites File的默认编码方式为UTF-8,点击Update就可以了!

查看更多...

Tags: 未能保存 中文

分类:Sevrice&IDE | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 922