# 【新功能：双语对齐，单词听写】Milkyway-Cloze-Plus：【双语阅读，生词辅助】

**URL:** <https://forum.freemdict.com/t/topic/16422>\
**Category:** 软件经验交流展望\
**Tags:** 英汉, ﻿英语\
**Created:** [2022 年10 月 21 日 05:21 UTC](https://forum.freemdict.com/t/topic/16422 "2022-10-21T05:21:40Z")\
**Posts on this page:** 1\
**Showing post:** 106

<div class="post-metadata">

作者： ![L65W3E4](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/l65w3e4/32/30036_2.png) [@L65W3E4](https://forum.freemdict.com/u/L65W3E4)\
发布日期： [2022 年11 月 7 日 02:55 UTC](https://forum.freemdict.com/t/topic/16422/106 "2022-11-07T02:55:15Z")

</div>

关于 **词组** 识别问题的讨论

一、词组分类

1. 介词短语
2. 短语动词（时态、单复数）
3. 名词短语（单复数）
4. 固定搭配 （？可能包含1、2、3、5、6）
5. 习语
6. 其他

二、识别方法：使用 **正则表达式** ，根据词典文件词条 一 一匹配；

> 问题： 时态、单复数变化；

**方案一：**

> 例：Bobby **looked at** her with a sheepish grin.博比望着她腼腆地咧嘴一笑。

1、按空格拆成数组 `[“Bobby”, “looked”, “at” ,“her”, “with”, “a” ,“sheepish”, “grin”]`  
2、按规则还原原形，合并为新数组

> ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/e/e/ee0b423397a0c26879130c7a9ad38eb57b9e7f52.png)  
> 如果length\>1，push();  
> 如果length=1，concat()；  
> 得 `[“Bobby”,[“looked”,“look”], “at” ,“her”, “with”, “a” ,“sheepish”, “grin”]`

3、按照词典词条匹配，找出 **look at**

> 将词条look at拆成`["look", "at"]`  
> 先找 **look** ，找到后判断后一个元素是不是 **at**

> 缺点：如果词条数量比较多，就比较花时间；

4、给原文中 **looked at** 添加标签

* * *

**【方案一】效果：**

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/d/2/d20b5ef9ce464f4fb2ba4d17ba381d2e8b6c6c76.png)  
 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/b/6/b60da405abeab53c37c0401d56e0e7f6f754853a.png)

---

_[View the full topic](https://forum.freemdict.com/t/topic/16422)._
