各路神人:
     请问通过什么代码才能对一段信息进行智能识别和提取呢,例如:“***您好,请于****年**月**日在****集合开会。”仅提取出这段信息的时间和地点,简化信息。个人觉得难度在于时间和地点的识别,因为每条信息的时间地点格式都不同。请各路神人指点迷津。。【解答尽量详细些】

解决方案 »

  1.   

    既然“请于”两个字确定有,“年”,“月”,“日在”,“集合开会”这些字都确定第条信息中都有就好办了啊,字符串判断或者正则都可以实现吧?
    String content = "李先生您好,请于2011年12月13日在人民大会堂集合开会";
    if(content!=null){
       String tempName = content.substring(0,content.lastIndexOf("您好")); //名称提取出来了
       String tempYear = content.substring(content.lastIndexOf("请于")+2,content.lastIndexOf("年")); //年份提取出来了
       String tempMon = content.substring(content.lastIndexOf("年")+1,content.lastIndexOf("月")); //月份提取出来了
       String tempDay = content.substring(content.lastIndexOf("月")+1,content.lastIndexOf("日")); //日份提取出来了
       String tempAdd = content.substring(content.lastIndexOf("日在")+2,content.lastIndexOf("集合开会")); //地址提取出来了
       System.out.println(tempName+tempYear+tempMon+tempDay+tempAdd);
    }我写的很差劲,不过功能应该是你要的