查看: 770|回复: 6
打印 上一主题 下一主题

[求助] 求助 词义的序号是如何办到的

[复制链接]

该用户从未签到

43

主题

448

回帖

3793

积分

贡士

Rank: 6Rank: 6

积分
3793

灌水大神章小蜜蜂章笑傲江湖章

跳转到指定楼层
1
发表于 2015-11-11 20:01:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在制作字典过程中,在原材料里面,每一个词条的解释下面都分成许多解释的条目,如果意思不一样,就要另一个解释,比如下面的词条,对比着原txt文本,和当前mdict的桌面显示,请问每一个解释下面的序号是如何生成的。仅仅是正则表达式,还是通过别的软件办成的

about
about [a.bout]<br>[AHD:[&2{…-bout“}] ][D.J.[&2{*6ba&t}]][K.K.[&2{*6ba&t}]]<br>
<i><b>adv.Abbr. <b>a.</b>,<b>ab.</b>,<b>abt.</b>(副词)缩写 <b>a.</b>,<b>ab.</b>,<b>abt.</b></b></i><br>&#9829;[Approximately; nearly:]&#8226;[相近;将近:]<br>&#9827;&#9830;[The interview lasted about an hour.]&#8226;[面试延续了近一个小时]<br>&#9829;[Almost:]&#8226;[差不多,几乎:]<br>&#9827;&#9830;[The job is about done.]&#8226;[工作差不多要完成了]<br>&#9829;[To a reversed position or direction:]&#8226;[沿反方向:到一相反的位置或方向:]<br>&#9827;&#9830;[Turn about and walk away slowly.]&#8226;[转过身慢慢地走开]<br>&#9829;[In no particular direction:]&#8226;[到处,各处:没有确定方向地:]<br>&#9827;&#9830;[wandering about with no place to go.]&#8226;[四处漂泊,无处可去]<br>&#9829;[All around; on every side:]&#8226;[四周;各个方向:]<br>&#9827;&#9830;[Let's look about for help.]&#8226;[让我们四处寻求帮助]<br>&#9829;[In the area or vicinity; near:]&#8226;[在近处,附近:在一地区或附近;近旁:]<br>&#9827;&#9830;[spoke to a few spectators standing about.]&#8226;[和站在附近的围观者交谈]<br>&#9829;[In succession; one after another:]&#8226;[连续;接二连三:]<br>&#9827;&#9830;[Turn about is fair play.]&#8226;[按顺序来是公平的]<br>
<i><b>prep.(介词)</b></i><br>&#9829;[On all sides of; surrounding:]&#8226;[在…四周;环绕:]<br>&#9827;&#9830;[I found an English garden all about me.]&#8226;[在我四周环绕着一个英式花园]<br>&#9829;[In the vicinity of; around:]&#8226;[在…附近;靠近:]<br>&#9827;&#9830;[explored the rivers and streams about the estate.]&#8226;[探究地产周围的河流和小溪]<br>&#9829;[Almost the same as; close to; near.]&#8226;[差不多一样;相近;接近]<br>&#9829;[]&#8226;[]<br>&#9829;&#9824;[In reference to; relating to; concerned with:]&#8226;[关于:关于…;关系到;相关:]<br>&#9827;&#9830;[a book about snakes; objectivity—a part of what biography is about.]&#8226;[一本关于蛇的书;客观--是传记所力求的一部分]<br>&#9829;&#9824;[In the act or process of:]&#8226;[行动中,进程中:在…行动或进程中:]<br>&#9827;&#9830;[While you're about it, please clean your room.]&#8226;[趁你正在清理,请打扫一下你的房间]<br>&#9829;[In the possession or innate character of:]&#8226;[身上,性格中:在…身上或性格中:]<br>&#9827;&#9830;[Keep your wits about you.]&#8226;[你要长点心眼]<br>&#9829;[]&#8226;[]<br>&#9829;&#9824;[Ready or prepared to do something:]&#8226;[准备做,预备做:准备或预备做某事:]<br>&#9827;&#9830;[The chorus is about to sing.]&#8226;[合唱团就要开始唱了]<br>&#9829;&#9824;[<i>Usage Problem</i> Used with a negative to indicate strong intention:]&#8226;[<i>【用法疑难】</i> 根本就:和否定式连用表示很强的意向:]<br>&#9827;&#9830;[I am not about to concede the point.]&#8226;[我一点也不认同这个观点]<br>
<i><b>adj.(形容词)</b></i><br>&#9829;[Moving here and there; astir:]&#8226;[四处活动的;运动的:]<br>&#9827;&#9830;[The patient is up and about.]&#8226;[病人已能活动]<br>&#9829;[Being in evidence or existence:]&#8226;[显著的,存在的:]<br>&#9827;&#9830;[Rumors are about concerning his resignation.]&#8226;[谣传说他要辞职]<br><语源><br>&#9829;[Middle English ]&#8226;[中古英语 ]<br>&#9829;[from Old English <i>onbūtan</i> ]&#8226;[源自 古英语 <i>onbūtan</i> ]<br>&#9829;[<i>on</i> [in] * see  <b>on</b> ]&#8226;[<i>on</i> [在…里面] *参见 <b>on</b>]<br>&#9829;[<i>būtan</i> [outside] * see  ud- ]&#8226;[<i>būtan</i> [在…外面] *参见 ud- ]<br><用法><br>&#9829;[The construction <i>not about to</i>  is often used to express determination:  ]&#8226;[该结构<i>not about to</i> 常用来表示决定:  ]<br>&#9827;&#9830;[We are not about to negotiate with terrorists. ]&#8226;[我们是不会和恐怖分子谈判的。 ]<br>&#9829;[ A majority of the Usage Panel considers this usage acceptable in speech but not in formal writing. ·<i>About</i>  is traditionally used to refer to the relation between a narrative and its subject:  ]&#8226;[用法小组大部分人员都认为在口语中可这样用,但在正式书面语中却不行。<i>About</i> 传统上用来指一叙事与其主题的关系:  ]<br>&#9827;&#9830;[a book about Cézanne,]&#8226;[一本关于塞尚的书;]<br>&#9827;&#9830;[a movie about the Boston Massacre. ]&#8226;[一部关于波士顿大屠杀的电影。 ]<br>&#9829;[This use has lately been extended to refer to the relation between various nonlinguistic entities and the things they make manifest,as in <i>The party was mostly about showing off their new offices</i>  or <i>His designs are about the use of rough-textured materials.</i>   This practice probably originates with the expression <i>That's what it's all about</i>  and may partly reflect implicit deference to the postmodern doctrine that every social artifact and activity can be regarded as a text subject to interpretation. But the usage is still too voguish to have won general acceptance;it is rejected by 59 percent of the Usage Panel in the example ]&#8226;[这种用法现已被扩展到表示各种非语言作品和它所表现的事物之间的关系,比如在<i>该政党大肆吹嘘他们的新官员</i> 或 <i>他的设计使用天然质地的原材料。</i>  这种用法可能是源自<i>这就是全部情况</i> 的表示法,也许部分地反应了一种内在的区别:以后现代主义的观点来看,每一社会产物或活动都可视为需解释的一种主题。 但这种用法流行期太短暂而没有得到普遍的认可;百分之五十九的用法小组人员都认为下面的例子是不正确的: ]<br>&#9827;&#9830;[A designer teapot isn't about making tea;]&#8226;[一个茶壶设计师不关心茶的制作;]<br>&#9827;&#9830;[it is about letting people know that you have a hundred dollars to spend on a teapot. ]&#8226;[让人们知道你可花一百美元买一只茶壶 ]
</>

当前在字典中显示如下
about
[a.bout][AHD:[&2{…-bout“}] ][D.J.[&2{*6ba&t}]][K.K.[&2{*6ba&t}]]
adv.Abbr. a.,ab.,abt.(副词)缩写 a.,ab.,abt.
&#9829;[Approximately; nearly:]&#8226;[相近;将近:]
&#9827;&#9830;[The interview lasted about an hour.]&#8226;[面试延续了近一个小时]
&#9829;[Almost:]&#8226;[差不多,几乎:]
&#9827;&#9830;[The job is about done.]&#8226;[工作差不多要完成了]
&#9829;[To a reversed position or direction:]&#8226;[沿反方向:到一相反的位置或方向:]
&#9827;&#9830;[Turn about and walk away slowly.]&#8226;[转过身慢慢地走开]
&#9829;[In no particular direction:]&#8226;[到处,各处:没有确定方向地:]
&#9827;&#9830;[wandering about with no place to go.]&#8226;[四处漂泊,无处可去]
&#9829;[All around; on every side:]&#8226;[四周;各个方向:]
&#9827;&#9830;[Let's look about for help.]&#8226;[让我们四处寻求帮助]
&#9829;[In the area or vicinity; near:]&#8226;[在近处,附近:在一地区或附近;近旁:]
&#9827;&#9830;[spoke to a few spectators standing about.]&#8226;[和站在附近的围观者交谈]
&#9829;[In succession; one after another:]&#8226;[连续;接二连三:]
&#9827;&#9830;[Turn about is fair play.]&#8226;[按顺序来是公平的]
prep.(介词)
&#9829;[On all sides of; surrounding:]&#8226;[在…四周;环绕:]
&#9827;&#9830;[I found an English garden all about me.]&#8226;[在我四周环绕着一个英式花园]
&#9829;[In the vicinity of; around:]&#8226;[在…附近;靠近:]
&#9827;&#9830;[explored the rivers and streams about the estate.]&#8226;[探究地产周围的河流和小溪]
&#9829;[Almost the same as; close to; near.]&#8226;[差不多一样;相近;接近]
&#9829;[]&#8226;[]
&#9829;&#9824;[In reference to; relating to; concerned with:]&#8226;[关于:关于…;关系到;相关:]
&#9827;&#9830;[a book about snakes; objectivity—a part of what biography is about.]&#8226;[一本关于蛇的书;客观--是传记所力求的一部分]
&#9829;&#9824;[In the act or process of:]&#8226;[行动中,进程中:在…行动或进程中:]
&#9827;&#9830;[While you're about it, please clean your room.]&#8226;[趁你正在清理,请打扫一下你的房间]
&#9829;[In the possession or innate character of:]&#8226;[身上,性格中:在…身上或性格中:]
&#9827;&#9830;[Keep your wits about you.]&#8226;[你要长点心眼]
&#9829;[]&#8226;[]
&#9829;&#9824;[Ready or prepared to do something:]&#8226;[准备做,预备做:准备或预备做某事:]
&#9827;&#9830;[The chorus is about to sing.]&#8226;[合唱团就要开始唱了]
&#9829;&#9824;[Usage Problem Used with a negative to indicate strong intention:]&#8226;[【用法疑难】 根本就:和否定式连用表示很强的意向:]
&#9827;&#9830;[I am not about to concede the point.]&#8226;[我一点也不认同这个观点]
adj.(形容词)
&#9829;[Moving here and there; astir:]&#8226;[四处活动的;运动的:]
&#9827;&#9830;[The patient is up and about.]&#8226;[病人已能活动]
&#9829;[Being in evidence or existence:]&#8226;[显著的,存在的:]
&#9827;&#9830;[Rumors are about concerning his resignation.]&#8226;[谣传说他要辞职]
<语源>
&#9829;[Middle English ]&#8226;[中古英语 ]
&#9829;[from Old English onbūtan ]&#8226;[源自 古英语 onbūtan ]
&#9829;[on [in] * see on ]&#8226;[on [在…里面] *参见 on]
&#9829;[būtan [outside] * see ud- ]&#8226;[būtan [在…外面] *参见 ud- ]
<用法>
&#9829;[The construction not about to is often used to express determination: ]&#8226;[该结构not about to 常用来表示决定: ]
&#9827;&#9830;[We are not about to negotiate with terrorists. ]&#8226;[我们是不会和恐怖分子谈判的。 ]
&#9829;[ A majority of the Usage Panel considers this usage acceptable in speech but not in formal writing. ·About is traditionally used to refer to the relation between a narrative and its subject: ]&#8226;[用法小组大部分人员都认为在口语中可这样用,但在正式书面语中却不行。About 传统上用来指一叙事与其主题的关系: ]
&#9827;&#9830;[a book about Cézanne,]&#8226;[一本关于塞尚的书;]
&#9827;&#9830;[a movie about the Boston Massacre. ]&#8226;[一部关于波士顿大屠杀的电影。 ]
&#9829;[This use has lately been extended to refer to the relation between various nonlinguistic entities and the things they make manifest,as in The party was mostly about showing off their new offices or His designs are about the use of rough-textured materials. This practice probably originates with the expression That's what it's all about and may partly reflect implicit deference to the postmodern doctrine that every social artifact and activity can be regarded as a text subject to interpretation. But the usage is still too voguish to have won general acceptance;it is rejected by 59 percent of the Usage Panel in the example ]&#8226;[这种用法现已被扩展到表示各种非语言作品和它所表现的事物之间的关系,比如在该政党大肆吹嘘他们的新官员 或 他的设计使用天然质地的原材料。 这种用法可能是源自这就是全部情况 的表示法,也许部分地反应了一种内在的区别:以后现代主义的观点来看,每一社会产物或活动都可视为需解释的一种主题。 但这种用法流行期太短暂而没有得到普遍的认可;百分之五十九的用法小组人员都认为下面的例子是不正确的: ]
&#9827;&#9830;[A designer teapot isn't about making tea;]&#8226;[一个茶壶设计师不关心茶的制作;]
&#9827;&#9830;[it is about letting people know that you have a hundred dollars to spend on a teapot. ]&#8226;[让人们知道你可花一百美元买一只茶壶 ]

要想达到如下的结果,仅仅问词条解释的序号是怎么办到的,忘不吝赐教
about
a.bout  AHD[&#601;-bout&#697;]   DJ[&#601;&#712;baut]  KK[&#601;&#712;baut]
adv.Abbr. a.,ab.,abt.(副词)缩写 a.,ab.,abt.
1. Approximately; nearly:
    相近;将近:
    The interview lasted about an hour.
  &#8201;&#8201;面试延续了近一个小时
2. Almost:
    差不多,几乎:
    The job is about done.
  &#8201;&#8201;工作差不多要完成了
3. To a reversed position or direction:
    沿反方向:到一相反的位置或方向:
    Turn about and walk away slowly.
  &#8201;&#8201;转过身慢慢地走开
4. In no particular direction:
    到处,各处:没有确定方向地:
    wandering about with no place to go.
  &#8201;&#8201;四处漂泊,无处可去
5. All around; on every side:
    四周;各个方向:
    Let's look about for help.
  &#8201;&#8201;让我们四处寻求帮助
6. In the area or vicinity; near:
    在近处,附近:在一地区或附近;近旁:
    spoke to a few spectators standing about.
  &#8201;&#8201;和站在附近的围观者交谈
7. In succession; one after another:
    连续;接二连三:
    Turn about is fair play.
  &#8201;&#8201;按顺序来是公平的
prep.(介词)
1. On all sides of; surrounding:
    在…四周;环绕:
    I found an English garden all about me.
  &#8201;&#8201;在我四周环绕着一个英式花园
2. In the vicinity of; around:
    在…附近;靠近:
    explored the rivers and streams about the estate.
  &#8201;&#8201;探究地产周围的河流和小溪
3. Almost the same as; close to; near.
    差不多一样;相近;接近
4. In reference to; relating to; concerned with:
    关于:关于…;关系到;相关:
    a book about snakes; objectivity—a part of what biography is about.
  &#8201;&#8201;一本关于蛇的书;客观--是传记所力求的一部分
5. In the act or process of:
    行动中,进程中:在…行动或进程中:
    While you're about it, please clean your room.
  &#8201;&#8201;趁你正在清理,请打扫一下你的房间
6. In the possession or innate character of:
    身上,性格中:在…身上或性格中:
    Keep your wits about you.
  &#8201;&#8201;你要长点心眼
7. Ready or prepared to do something:
    准备做,预备做:准备或预备做某事:
    The chorus is about to sing.
  &#8201;&#8201;合唱团就要开始唱了
8. Usage Problem Used with a negative to indicate strong intention:
  【用法疑难】 根本就:和否定式连用表示很强的意向:
    I am not about to concede the point.
  &#8201;&#8201;我一点也不认同这个观点
adj.(形容词)
1. Moving here and there; astir:
    四处活动的;运动的:
    The patient is up and about.
  &#8201;&#8201;病人已能活动
2. Being in evidence or existence:
    显著的,存在的:
    Rumors are about concerning his resignation.
  &#8201;&#8201;谣传说他要辞职
ORIGIN
1. Middle English
    中古英语
2. from Old English onb&9{&#191;tan}
    源自 古英语 onb&9{&#191;tan}
3. on [in] * see  on
    on [在…里面] *参见 on
4. b&9{&#191;tan} [outside] * see  ud-
    b&9{&#191;tan} [在…外面] *参见 ud-
USAGE
1. The constructionnot about to  is often used to express determination:   
    该结构not about to 常用来表示决定:   
    We are not about to negotiate with terrorists.
  &#8201;&#8201;我们是不会和恐怖分子谈判的。
2. A majority of the Usage Panel considers this usage acceptable in speech but not in formal writing. ·About  is traditionally used to refer to the relation between a narrative and its subject:   
    用法小组大部分人员都认为在口语中可这样用,但在正式书面语中却不行。About 传统上用来指一叙事与其主题的关系:   
    a movie about the Boston Massacre.
  &#8201;&#8201;一部关于波士顿大屠杀的电影。
3. This use has lately been extended to refer to the relation between various nonlinguistic entities and the things they make manifest,as inThe party was mostly about showing off their new offices  or His designs are about the use of rough-textured materials.   This practice probably originates with the expressionThat's what it's all about  and may partly reflect implicit deference to the postmodern doctrine that every social artifact and activity can be regarded as a text subject to interpretation. But the usage is still too voguish to have won general acceptance;it is rejected by 59 percent of the Usage Panel in the example
    这种用法现已被扩展到表示各种非语言作品和它所表现的事物之间的关系,比如在该政党大肆吹嘘他们的新官员 或 他的设计使用天然质地的原材料。  这种用法可能是源自这就是全部情况 的表示法,也许部分地反应了一种内在的区别:以后现代主义的观点来看,每一社会产物或活动都可视为需解释的一种主题。 但这种用法流行期太短暂而没有得到普遍的认可;百分之五十九的用法小组人员都认为下面的例子是不正确的:
    it is about letting people know that you have a hundred dollars to spend on a teapot.
  &#8201;&#8201;让人们知道你可花一百美元买一只茶壶

该用户从未签到

1

主题

152

回帖

553

积分

举人

Rank: 4

积分
553

灌水大神章小蜜蜂章笑傲江湖章

2
发表于 2015-11-12 15:22:12 | 只看该作者
本帖最后由 css 于 2015-11-12 16:21 编辑

就本问题而言, 正则可能是不可或缺, 但一定不是有正则即可万全。有没有一个软件可以满足楼主本题之确切需求且一蹴而就, 深表怀疑。
不妨如此这般:
一、抽丝剥茧, 先按断行分离词目、词性、释义等等;
二、庖丁解牛,逐级逐步分离释义后面的释义或例句, 这个过程中, 你可以逐级加数字标号, 想怎么加就怎么加。PS: 在某些支持编程的编辑软件上(Emacs? Vim?), 这一步骤确实可以适当编程。但事实上, 就算真会编程, 也不见得非得编程: 原因有两个: 1) 单一条目的释义总是有限的, 而且是非常有限的; 2)你可能不那么愿意丧失这么好的统计调查之契机。

Good luck with that.

该用户从未签到

20

主题

222

回帖

4029

积分

贡士

Rank: 6Rank: 6

积分
4029

灌水大神章小蜜蜂章笑傲江湖章

3
发表于 2015-11-13 14:30:44 | 只看该作者
css 发表于 2015-11-12 15:22
就本问题而言, 正则可能是不可或缺, 但一定不是有正则即可万全。有没有一个软件可以满足楼主本题之确切需 ...

不用這麼麻煩,html tag或css都能對個別項目自動編序號。

雖然統計調查確實是辦不到,不過下個指令,就能抓出最多義項的單字。

该用户从未签到

110

主题

685

回帖

2万

积分

状元

Rank: 9Rank: 9Rank: 9

积分
23333

灌水大神章小蜜蜂章笑傲江湖章

4
发表于 2015-11-13 16:14:33 | 只看该作者
本帖最后由 Langheping 于 2015-11-14 00:49 编辑

第一步, 看你是否可以做到这一点:
  1. <ol>
  2. <li>&#9829;[Approximately; nearly:]<BR>&#8226;[相近;将近:])<BR>&#9827;&#9830;[The interview lasted about an hour.]<BR>&#8226;[面试延续了近一个小时]</li>
  3. <li>&#9829;[Almost:]<BR>&#8226;[差不多,几乎:]<BR>&#9827;&#9830;[The job is about done.]<BR>&#8226;[工作差不多要完成了]</li>
  4. <li>&#9829;[To a reversed position or direction:]<BR>&#8226;[沿反方向:到一相反的位置或方向:]<BR>&#9827;&#9830;[Turn about and walk away slowly.]<BR>&#8226;[转过身慢慢地走开]-</li>
  5. </ol>
复制代码



用正则也可以在前面加数字,要replace 多次。 First time, place the first &#9829; as 1. , Second time as 2 and so forth.

First time
Find: &#9829;(?<sub>.*?) $
replace 1. \1

Second time
Find: &#9829;(?<sub>.*?) $
replace 2. \1

Third time
Find: &#9829;(?<sub>.*?) $
replace 3. \1
...

该用户从未签到

43

主题

448

回帖

3793

积分

贡士

Rank: 6Rank: 6

积分
3793

灌水大神章小蜜蜂章笑傲江湖章

5
 楼主| 发表于 2015-11-14 12:36:16 | 只看该作者
上面的方法似乎不可以,因为一个词下面可能有动词、名词形容词等,每一词性下面又有好几种解释,如何保证第一次只替换相应词性下面的第一个,而不替换第二个 如何保证不是一次全部替换呢,还要进一步设置。

该用户从未签到

110

主题

685

回帖

2万

积分

状元

Rank: 9Rank: 9Rank: 9

积分
23333

灌水大神章小蜜蜂章笑傲江湖章

6
发表于 2015-11-14 23:39:13 | 只看该作者
本帖最后由 Langheping 于 2015-11-14 23:43 编辑

First, they must be one line. The first start with &#9829;.
The same theory I used to convert bgl file with multiple headings, such as: a|b|c|d|e|f|g

I have edited old stardict by using the same method. Try first.

If not, 你可以把文档给我,我可以用上面方法。

该用户从未签到

43

主题

448

回帖

3793

积分

贡士

Rank: 6Rank: 6

积分
3793

灌水大神章小蜜蜂章笑傲江湖章

7
 楼主| 发表于 2015-11-15 11:46:20 | 只看该作者
本帖最后由 zhlpen 于 2015-11-15 12:34 编辑

好的,谢谢,我的词典是个老版本,别人已经转换过了,就是美国传统英汉双解词典,只是想学一下如何转换成mdx格式,你想要我可以传给你,告诉你的邮箱,还有你说的bgl格式的词头a|a1|a2|a3|......|a200|....是如何处理的,如何把a1,a2,a3.....a200,...等词头的

我明白是如何办到的了,初始的文本必须是所有的解释行是一行不能分行否则就会从1开始了,提前要做的是必须要先把各种词性比如名词、动词、等和需要从1开始添加行号的区分出来,使它们确保第一次寻找是从每个需要从1开始加行号的,之后就能够把每一个标记逐次替换加行号了。谢谢你的提醒,网友的智慧无穷。