百词斩不认识单词例句导出

news/2025/1/15 22:41:10/

安卓app百词斩,重点词汇2235,不认识词汇难背词汇1788

百词斩本地数据库和离线包位置:

1、重点词汇2235,不认识词汇1788,认识词汇2235-1788

2、将认识词汇2235-1788加星号收藏,收藏单词存于baicizhandoexampleinfo.db的tb_collect_words表中

3、拎出考研重点词汇后循环遍历,剔除收藏的词汇,剩下的就是不认识词汇

4、遍历zpk文件,截取里面json字符串,解析并比对单词,属于不认识词汇的,就拎出json里面的例句、翻译、单词、释义

package com.example.demo;import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;import ch.qos.logback.core.util.FileUtil;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.FileSystemUtils;
import java.sql.*;//导入java.sql包中相关类
import java.util.ArrayList;
import java.util.List;public class demo {public static void main(String[] args)  {List<String> topicList=new ArrayList<String>();List<String> topicList1=new ArrayList<String>();List<String> topicList4=new ArrayList<String>();List<String> topicList5=new ArrayList<String>();Connection conn=connect();String sql="select * from topic_book_map where book_ids like \"%13%\"";//将从表中查询到的的所有信息存入sqltry {Statement stmt = conn.createStatement();//得到Statement实例ResultSet rs = stmt.executeQuery(sql);//执行SQL语句返回结果集while (rs.next()) {//输出获得记录中的"name","sex","age"字段的值String topicId=rs.getString("topic_id");String bookIds=rs.getString("book_ids");String[] dd=bookIds.split(",");int flag=0;for (String item:dd) {if(item.equals("21")&&flag==0){topicList.add(topicId);flag=1;}}}System.out.println("topic数量"+topicList.size());for (String item:topicList) {
//                String sqlll="select * from dict_a_b where topic_id=\""+item+"\";";
//                ResultSet rs1 = stmt.executeQuery(sqlll);
//                if(rs1.next()){
//                    topicList1.add(rs1.getString("word"));
//                }String sqll3="select * from dict_bcz where topic_id=\""+item+"\";";ResultSet rs3 = stmt.executeQuery(sqll3);if(rs3.next()){topicList1.add(rs3.getString("word"));}
//                String sqll4="select * from dict_c where topic_id=\""+item+"\";";
//                ResultSet rs4 = stmt.executeQuery(sqll4);
//                if(rs4.next()){
//                    topicList1.add(rs4.getString("word"));
//                }
//                String sqll5="select * from dict_d_f where topic_id=\""+item+"\";";
//                ResultSet rs5 = stmt.executeQuery(sqll5);
//                if(rs5.next()){
//                    topicList1.add(rs5.getString("word"));
//                }
//                String sqll6="select * from dict_g_k where topic_id=\""+item+"\";";
//                ResultSet rs6 = stmt.executeQuery(sqll6);
//                if(rs6.next()){
//                    topicList1.add(rs6.getString("word"));
//                }
//                String sqll7="select * from dict_l_o where topic_id=\""+item+"\";";
//                ResultSet rs7 = stmt.executeQuery(sqll7);
//                if(rs7.next()){
//                    topicList1.add(rs7.getString("word"));
//                }
//                String sqll8="select * from dict_p_r where topic_id=\""+item+"\";";
//                ResultSet rs8 = stmt.executeQuery(sqll8);
//                if(rs8.next()){
//                    topicList1.add(rs8.getString("word"));
//                }
//                String sqll9="select * from dict_s where topic_id=\""+item+"\";";
//                ResultSet rs9 = stmt.executeQuery(sqll9);
//                if(rs9.next()){
//                    topicList1.add(rs9.getString("word"));
//                }
//                String sqll2="select * from dict_t_z where topic_id=\""+item+"\";";
//                ResultSet rs2 = stmt.executeQuery(sqll2);
//                if(rs2.next()){
//                    topicList1.add(rs2.getString("word"));
//                }}System.out.println("单词数量"+topicList1.size());}catch (SQLException e) {System.out.println("查询数据时出错!"+e.getMessage());}try {Connection conn1=connect1();Statement stmtww = conn1.createStatement();//得到Statement实例for (String item:topicList1) {String sqlwww1="select * from tb_collect_words where word=\""+item+"\";";ResultSet rsff = stmtww.executeQuery(sqlwww1);int flag=0;while (rsff.next()) {flag=1;}if(flag==0){topicList4.add(item);}}System.out.println("未学习单词数量"+topicList4.size());}catch (SQLException e) {System.out.println("查询数据时出错!"+e.getMessage());}String json="";String json1="";File [] files=null;try {File file = new File("C:\\Users\\Administrator\\Desktop\\baicizhan(1)\\baicizhan\\zpack\\");files = file.listFiles();} catch (Exception e) {}for (File item:files) {try{String ffff= null;ffff = FileUtils.readFileToString(item,"UTF-8");json=StringUtils.substringBefore(StringUtils.substringAfter(ffff,"{\"topic_id\""),"\"}");json1="{\"topic_id\""+json+"\"}";JSONObject outJson = JSONObject.parseObject(json1);String wordfff = outJson.getString("word");String accent = outJson.getString("accent");String mean_cn = outJson.getString("mean_cn");String sentence = outJson.getString("sentence");String sentence_trans = outJson.getString("sentence_trans");String res=sentence+"#"+sentence_trans+"#"+wordfff+","+accent+"#"+mean_cn;System.out.println(res);for (String item1:topicList4) {if(wordfff.equals(item1)){topicList5.add(res);}}//                    System.out.println(wordfff);} catch (Exception e) {
//                    System.out.println(json);json=StringUtils.substringBefore(StringUtils.substringAfter("{\"topic_id\""+json,"{\"topic_id\""),"}}");json1="{\"topic_id\""+json+"}}";JSONObject outJson = JSONObject.parseObject(json1);String wordfff = outJson.getString("word");String accent = outJson.getString("accent");String mean_cn = outJson.getString("mean_cn");mean_cn=mean_cn.replace(",",",");String sentence = outJson.getString("sentence");sentence=sentence.replace(",",",");String sentence_trans = outJson.getString("sentence_trans");sentence_trans=sentence_trans.replace(",",",");String res=sentence+"#"+sentence_trans+"#"+wordfff+","+accent+"#"+mean_cn;System.out.println(res);for (String item1:topicList4) {if(wordfff.equals(item1)){topicList5.add(res);}}//                    e.printStackTrace();}}System.out.println(topicList5.size());try {FileUtils.writeLines(new File("C:\\Users\\Administrator\\Desktop\\qqq\\weixuexi1.csv"),topicList5);} catch (IOException e) {e.printStackTrace();}//System.out.println(encryption("123456", "12345688"));}private static Connection connect1(){Connection conn = null;//定义数据库连接对象try {String url = "jdbc:sqlite:C:\\Users\\Administrator\\Desktop\\baicizhan(2)\\baicizhan\\baicizhandoexampleinfo.db";   //定义连接数据库的url(url:访问数据库的URL路径),test为数据库名称Class.forName("org.sqlite.JDBC");//加载数据库驱动conn = DriverManager.getConnection(url);    //获取数据库连接System.out.println("数据库连接成功!\n");//数据库连接成功输出提示}//捕获异常信息catch (ClassNotFoundException | SQLException e) {System.out.println("数据库连接失败!"+e.getMessage());}return conn;//返回一个连接}private static Connection connect(){Connection conn = null;//定义数据库连接对象try {String url = "jdbc:sqlite:C:\\Users\\Administrator\\Desktop\\baicizhan(2)\\baicizhan\\lookup.db";   //定义连接数据库的url(url:访问数据库的URL路径),test为数据库名称Class.forName("org.sqlite.JDBC");//加载数据库驱动conn = DriverManager.getConnection(url);    //获取数据库连接System.out.println("数据库连接成功!\n");//数据库连接成功输出提示}//捕获异常信息catch (ClassNotFoundException | SQLException e) {System.out.println("数据库连接失败!"+e.getMessage());}return conn;//返回一个连接}public static String encryption(String plainData, String secretKey) {String result = null;try {Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");IvParameterSpec ivParameterSpec = new IvParameterSpec(secretKey.getBytes("UTF-8"));cipher.init(1, generateKey(secretKey), ivParameterSpec);byte[] buf = cipher.doFinal(plainData.getBytes());result = Base64.encodeBase64String(buf);} catch (Exception var6) {
//            logger.error(var6.getMessage(), var6);}return result;}public static String decryption(String secretData, String secretKey) {String result = null;try {Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");IvParameterSpec ivParameterSpec = new IvParameterSpec(secretKey.getBytes("UTF-8"));cipher.init(2, generateKey(secretKey), ivParameterSpec);byte[] buf = cipher.doFinal(Base64.decodeBase64(secretData));result = new String(buf, "utf-8");} catch (Exception var6) {
//            logger.error(var6.getMessage(), var6);}return result;}private static SecretKey generateKey(String secretKey) {try {SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");DESKeySpec keySpec = new DESKeySpec(secretKey.getBytes());return keyFactory.generateSecret(keySpec);} catch (Exception var3) {
//            logger.error(var3.getMessage(), var3);throw new RuntimeException("generate secretKey fail !!");}}private static String byteArray2HexStingr(byte[] bs) {StringBuffer sb = new StringBuffer();byte[] arrayOfByte = bs;int j = bs.length;for(int i = 0; i < j; ++i) {byte b = arrayOfByte[i];sb.append(byte2HexString(b));}return sb.toString();}private static String byte2HexString(byte b) {String hexStr = null;int n = b;if (b < 0) {n = b & 255;}hexStr = Integer.toHexString(n / 16) + Integer.toHexString(n % 16);return hexStr.toUpperCase();}public static String md5Hex(String origString) {String origMD5 = null;try {MessageDigest md5 = MessageDigest.getInstance("MD5");byte[] result = md5.digest(origString.getBytes("UTF-8"));origMD5 = byteArray2HexStingr(result);} catch (Exception var4) {
//            logger.error(var4.getMessage(), var4);}return origMD5;}public static String encodePassword(String rawPass, Object salt) {String saltedPass = mergePasswordAndSalt(rawPass, salt, false);MessageDigest messageDigest = getMessageDigest();byte[] digest = messageDigest.digest(encode(saltedPass));return new String(encode(digest));}protected static final MessageDigest getMessageDigest() throws IllegalArgumentException {try {return MessageDigest.getInstance("SHA-1");} catch (NoSuchAlgorithmException var1) {throw new IllegalArgumentException("No such algorithm [1]");}}protected static String mergePasswordAndSalt(String password, Object salt, boolean strict) {if (password == null) {password = "";}if (strict && salt != null && (salt.toString().lastIndexOf("{") != -1 || salt.toString().lastIndexOf("}") != -1)) {throw new IllegalArgumentException("Cannot use { or } in salt.toString()");} else {return salt != null && !"".equals(salt) ? password + "{" + salt.toString() + "}" : password;}}private static final Charset CHARSET = Charset.forName("UTF-8");public static byte[] encode(CharSequence string) {try {ByteBuffer bytes = CHARSET.newEncoder().encode(CharBuffer.wrap(string));byte[] bytesCopy = new byte[bytes.limit()];System.arraycopy(bytes.array(), 0, bytesCopy, 0, bytes.limit());return bytesCopy;} catch (CharacterCodingException var3) {throw new IllegalArgumentException("Encoding failed", var3);}}public static String decode(byte[] bytes) {try {return CHARSET.newDecoder().decode(ByteBuffer.wrap(bytes)).toString();} catch (CharacterCodingException var2) {throw new IllegalArgumentException("Decoding failed", var2);}}private static final char[] HEX = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};public static char[] encode(byte[] bytes) {int nBytes = bytes.length;char[] result = new char[2 * nBytes];int j = 0;for(int i = 0; i < nBytes; ++i) {result[j++] = HEX[(240 & bytes[i]) >>> 4];result[j++] = HEX[15 & bytes[i]];}return result;}public static byte[] decode(CharSequence s) {int nChars = s.length();if (nChars % 2 != 0) {throw new IllegalArgumentException("Hex-encoded string must have an even number of characters");} else {byte[] result = new byte[nChars / 2];for(int i = 0; i < nChars; i += 2) {int msb = Character.digit(s.charAt(i), 16);int lsb = Character.digit(s.charAt(i + 1), 16);if (msb < 0 || lsb < 0) {throw new IllegalArgumentException("Non-hex character in input: " + s);}result[i / 2] = (byte)(msb << 4 | lsb);}return result;}}}

 


http://www.ppmy.cn/news/855260.html

相关文章

破解百词斩单词数据之旅

作为一位英语爱好者&#xff0c;百词斩是我每天都会用的一款APP&#xff0c;这款应用可以自测词汇量&#xff0c;并巩固你的单词量&#xff0c;确实是一款用心的产品。作为一名雅思7分选手&#xff0c;个人觉得里面的发音和例句&#xff0c;对于口语还是有很大的帮助&#xff0…

英语学习APP—百词斩

英语学习APP-百词斩 1.简介&#xff1a; 百词斩是由成都超有爱科技有限公司针对英语学习开发的一款“图背单词软件”。软件为每一个单词提供了趣味的配图和例句&#xff0c;让记单词成为一种乐趣。 百词斩覆盖了从初高中、四六级、考研、到雅思、托福、SAT、GMAT、GRE等全部英语…

百词斩一面9.17

链接&#xff1a;https://www.nowcoder.com/discuss/111305 目录 Linux系统.Linux根目录下有哪些目录&#xff0c;各自存放些什么内容&#xff0c;交换分区的意义&#xff0c;文件添加可执行权限&#xff0c;分用户添加权限&#xff0c;超大日志文件里面的内容查找&#xff0…

扇贝单词与百词斩的竞品分析

任务二&#xff1a;做一个产品的竞品分析&#xff1a;扇贝单词与百词斩的竞品分析 一、概览 1竞品选择 扇贝单词&#xff08;版本&#xff1a;8.0.302&#xff09; 百词斩&#xff08;版本&#xff1a;6.2.15&#xff09; 选择百词斩和扇贝单词的原因…

百词斩不复习_百词斩是不是真的好用?

我用百词斩不到半年&#xff0c;但是四级词汇已经背了四遍了。 作为一个非英语专业的大一学生&#xff0c;我大学才开始用手机背单词(初中背单词就是拼读&#xff0c;一遍遍一个单词一个单词过&#xff0c;高中词汇量增加&#xff0c;小本本记读抄写&#xff0c;大学我课本都看…

使用百词斩如何减少复习量

有很多同学抱怨使用百词斩的时候&#xff0c;由于前一天学习的热情有如脱缰的野驴&#xff0c;在第二天在主页复习的时候累得吐血。这种情况嘛很好解决&#xff0c;这里列举3点&#xff1a; 1. 吐血了请及时擦掉&#xff0c;避免感染&#xff0c;有必要请移步医院挂号&#xf…

百词斩-每日语法

文章目录 1. in case ! in the case2. couple pair3. give的搭配短语4. "看"多种形式5. All6. 给元音字母穿上ad*pt外套7.通过的各个单词使用场景 每天使用《百词斩爱阅读》阅读一篇文章&#xff0c;然后&#xff0c;学习一个每天知识点。 1. in case ! in the case …

竞品分析 | 不背单词、百词斩

先说竞品分析结论&#xff08;迭代建议以及发展方向&#xff09; 1提升产品活跃度 与更多英语类资源商增加合作。丰富视频、文章、短句等内容&#xff0c;加强用户学习理解能力&#xff0c;加深用户粘性。优化产品结构。如首页的主题栏、仪表盘、个人信息等主干结构分支&…