我是程序自动生成的,我不会跳舞。"; // 调用JNI 命名实体识别 long btime = System.currentTimeMillis(); PrintUtils.print("文本长度: " text.length()); PrintUtils.print("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"); PrintUtils.print("舆情分析:"); try { // 判断输入参数 if (isEmpty(text)) throw new RuntimeException("文本内容为空!"); String[] str= text.split("[^\wu4E00-u9FA5] ");; PrintUtils.print("去噪后:"); for (String string : str) { PrintUtils.print(string); } int totalWord = 0; int totalKeyword = 0; // 获得要分析的单词数量 for (String string : str) { // 获得关键词并归一 String keywords = NLPUtil.getKeywords(string); String[] wordArray = keywords.split(","); for (String word : wordArray) { // 记录单词总数和关键词数量 totalWord ; if (!isEmpty(word)) { totalKeyword ; } } } double[] positive = new double[positiveCount]; double[] nagetive = new double[nagetiveCount]; for (int i = 0; i < positiveCount; i ) { positive[i] = 0; } for (int i = 0; i < nagetiveCount; i ) { nagetive[i] = 0; } int positiveTotal = 0; int nagetiveTotal = 0; // 构建正负面语料库 for (String string : str) { // 获得关键词并归一 String keywords = NLPUtil.getKeywords(string); String[] wordArray = keywords.split(","); for (String word : wordArray) { if (positiveMap.containsKey(word)) { // 记录单词总数和关键词数量 positive[positiveMap.get(word) - 1] ; } // 在负面表中则计数减一. if (nagetiveMap.containsKey(word)) { // 记录单词总数和关键词数量 nagetive[nagetiveMap.get(word) - 1] ; } } } // 计算正负面情感 for (