{"id":21899142,"url":"https://github.com/kylezb/idiom-guesser","last_synced_at":"2026-02-11T05:02:08.231Z","repository":{"id":149930588,"uuid":"466668062","full_name":"kylezb/idiom-guesser","owner":"kylezb","description":"一个用于解决类似汉兜、拼成语 这类应用的程序","archived":false,"fork":false,"pushed_at":"2022-09-14T02:01:27.000Z","size":6743,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T09:32:33.324Z","etag":null,"topics":["handle","wordle"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylezb.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-06T07:32:48.000Z","updated_at":"2024-07-18T06:26:42.000Z","dependencies_parsed_at":"2023-04-24T13:52:07.603Z","dependency_job_id":null,"html_url":"https://github.com/kylezb/idiom-guesser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kylezb/idiom-guesser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylezb%2Fidiom-guesser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylezb%2Fidiom-guesser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylezb%2Fidiom-guesser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylezb%2Fidiom-guesser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylezb","download_url":"https://codeload.github.com/kylezb/idiom-guesser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylezb%2Fidiom-guesser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["handle","wordle"],"created_at":"2024-11-28T14:38:14.443Z","updated_at":"2026-02-11T05:02:08.202Z","avatar_url":"https://github.com/kylezb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 介绍：\n这是一个用于解决类似[汉兜](https://handle.antfu.me)、[拼成语](https://allanchain.github.io/chinese-wordle/) 这类应用的程序\n\n## 目录结构\n```\n├─requirements.txt      依赖\n├─auto.py               自动猜成语\n├─guesser.py            主程序\n├─idiom.json            原始成语数据\n├─idiom_freq.json       成语频率数据\n├─idioms.sqlite         成语数据库\n├─idioms2db.py          生成成语数据库（非严格模式）\n├─idioms2db_strict.py   生成成语数据库（严格模式）\n├─img                   md_img\n└─userdata              自定义用户文件夹\n```\n\n## 使用说明\n运行 `guesser.py`\n\n\u003e  如果你猜的成语中某一个声母或韵母(对于汉兜来说，还包含汉字与音调)：\n\u003e  - 位置与待猜成语相同，它就会被标成绿色，我们用 **2** 来表示\n\u003e  - 出现在待猜成语中但位置错误，就是黄色，我们用 **1** 来表示\n\u003e  - 压根没出现在待猜成语中，就是灰色，我们用 **0** 来表示\n\u003e\n\u003e 根据上述规则，以汉兜为例：输入 `无忧无虑` 得到4个字对应的声母、韵母等情况\n\u003e\n\u003e  - 声母应该为 `0000`，由于默认是 `0000`，我们可以不填\n\u003e  - 韵母应该为 `0100`\n\u003e  - 汉字应该为 `0000`，由于默认是 `0000`，不填\n\u003e  - 声调应该为 `0100`\n\u003e\n\u003e 敲下回车后会返回匹配的条目数以及出现频率最高的前20个成语备选  \n\u003e 重复上述操作，应该会在3-4次内得到答案 \n\n|*|程序|结果|\n| ----| ---- | ---- |\n|[汉兜](https://handle.antfu.me)|![ex1](./img/ex1.png) | ![ex2](./img/ex2.png) |\n|[拼成语](https://allanchain.github.io/chinese-wordle/)|![ex3](./img/ex3.png) | ![ex4](./img/ex4.png) |\n\n## 更多\n基于[Playwright](https://playwright.dev/) 的自动化 ~~无情的~~ 猜成语机器\n![gif1](./img/gif1.gif) \n使用idiom-guesser基本能在3-4次内猜出成语\n\n![ex5](./img/ex5.png) \n5000次的数据，应该有较强的参考性\n\n### 注意\n使用下列代码将启用浏览器无痕模式\n\n```\n    browser = playwright.chromium.launch(headless=False, channel=\"msedge\")\n    context = browser.new_context()\n    page = context.new_page()\n```\n若不想以无痕模式启动，使用下列代码\n详见[playwright官网](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context)\n```   \n    browser = playwright.chromium.launch_persistent_context(\n        headless=False,\n        channel=\"msedge\",\n        # 换成自己的用户目录,\n        user_data_dir='D:/path/to/userdata',\n    )\n    page = browser.new_page()\n```\n## 有用的提示\n推荐以这些词开局\n\n|成语|频率|成语|频率|成语|频率|\n| ---- | ---- |---- | ---- |---- | ---- |\n|长治久安|18732|一目了然|17310|无可厚非|13090|\n|取而代之|12053|排忧解难|11980|举足轻重|11820|\n|统筹兼顾|10847|热火朝天|9846|顺理成章|7282|\n|死灰复燃|6643|大江南北|6408|无可争辩|6047|\n|吃苦耐劳|5983|昏迷不醒|5980|一筹莫展|5585|\n|百花齐放|5578|语重心长|5502|大张旗鼓|5315|\n|轻描淡写|4927|不解之缘|4914|救死扶伤|4851|\n|狂风暴雨|4789|叹为观止|4764|街头巷尾|4673|\n|双管齐下|4511|刻骨铭心|4440|打成一片|4161|\n|嘘寒问暖|4004|酸甜苦辣|3773|异口同声|3745|\n|人声鼎沸|3667|得心应手|3642|袖手旁观|3614|\n|始终不渝|3581|害群之马|3557|背井离乡|3546|\n|轻重缓急|3361|剑拔弩张|3166|纸上谈兵|3153|\n|火上浇油|3036|风调雨顺|2927|正本清源|2865|\n|豁然开朗|2519|相濡以沫|2475|痛心疾首|2458|\n|打破常规|2386|保家卫国|2313|满载而归|2288|\n|瞒天过海|2234|峰回路转|2218|心满意足|2190|\n|三足鼎立|2179|汗马功劳|2138|天罗地网|2111|\n|以偏概全|2035|用心良苦|2027|步履维艰|1991|\n|崇山峻岭|1980|信手拈来|1932|多管闲事|1917|\n|周而复始|1880|一尘不染|1832|前因后果|1827|\n|表面文章|1800|花团锦簇|1787|心领神会|1742|\n|遍体鳞伤|1736|铁证如山|1694|身不由己|1673|\n|不堪回首|1673|一反常态|1618|先睹为快|1606|\n|枪林弹雨|1598|无懈可击|1571|雨过天晴|1535|\n|回心转意|1524|妙语连珠|1503|姹紫嫣红|1501|\n|见多识广|1498|大雨倾盆|1497|逆水行舟|1475|\n|思前想后|1442|答非所问|1432|弄巧成拙|1408|\n|口干舌燥|1384|灯红酒绿|1383|砸锅卖铁|1368|\n|神通广大|1359|天南地北|1347|墨守成规|1308|\n|繁花似锦|1301|柳暗花明|1298|铁面无私|1229|\n|狼吞虎咽|1214|万马奔腾|1194|赤手空拳|1192|\n|光彩夺目|1183|五光十色|1167|因循守旧|1154|\n|去伪存真|1122|广开言路|1116|百年之后|1112|\n|四脚朝天|1111|破釜沉舟|1100|马到成功|1082|\n|痛改前非|1079|杀人灭口|1072|为非作歹|1063|\n|由浅入深|1058|装聋作哑|1054|分庭抗礼|1053|\n|劈头盖脸|1053|无价之宝|1052|乔装打扮|1049|\n|画龙点睛|1040|胡思乱想|1040|扫地出门|1017|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylezb%2Fidiom-guesser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylezb%2Fidiom-guesser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylezb%2Fidiom-guesser/lists"}