用WORD统计字符出现次数WordConcord

xujiajin

管理员
Staff member
用WORD统计字符出现次数WordConcordancer
献给无产语言学者的检索工具

如果你什么检索软件都没有,特别是没有中文检索共具,特别是你还是一个尊重别人知识产权的典范,而且你还有如patric网友那样需要检索古汉语的。这里给大家介绍一个用宏做的词频统计方法。虽然操作上略显复杂,但使用起来实在简单。在Word里直接操作就可以。


**********
用WORD统计字符出现次数WordConcordancer

作者:逍遥浪子 改编者:许家金
  第一步 セWord菜单[工具]→[宏]→[宏],输入宏的名称“FindText” ,然后单击[创建]按钮。
  Step One: Find [Macro] from the dropdown menu [Tools]; and key in FindText as the Macro name, then click [Create] to start a new Macro.
  第二步 在弹出的VisualBasic编辑器的代码窗口中完成以下内容:
Step Two: Clear all the codes in the popup VisualBasic Editor window and paste the following codes exactly as it is into the VisualBasic Editor window.

Sub FindText()
Text = InputBox("Type in any word or word string in the input box below", "Corpus4u_Word_Concord!")
With ActiveDocument.Content.Find
Do While .Execute(FindText:=Text) = True
tim = tim + 1
Loop
End With
MsgBox ("In the current text I have found " + Str(tim) + " instance(s) of " + Text), 48, "Search_Result"
End Sub

  第三步 录入完毕后,单击菜单[文件]→[关闭并返回到Microsoft Word后]。
  Step Three: Save and close the VB Editor to return Microsoft Word
  第四步 单击菜单[工具]→[自定义],单击“命令”选项卡,在“类别”中选择“宏”,将右边的“Normal.NewMacros.FindText”命令拖入“编辑”菜单中,并右击拖入的命令,在“命名”框中重命名为“WordCount”。
  Step Four: Find [Customize] from the dropdown menu [Tools]; click [Command] and find [Macro], you will a macro named “Normal.NewMacros.FindText”. Then drag the macro and drop onto anywhere on the Format Toolbar. Finally rename the macro by right-clicking the button, and change “Normal.NewMacros.FindText” to “WordConcord” or any other name.

  以后要统计文本数量时,只要单击[WordConcord],按提示输入要查找的内容,单击[确定]就得到统计结果。
You can get the frequency of a key word or word string in the opened text by clicking the button, entering the key word.

Done.
Word版下载:
http://www.corpus4u.org/upload/forum/2005072216312263.doc
 
发布以后我发现上面的语句有折行现象。所以建议大家下载Word版,copy其中的语句,这样应该会更保险一些。

欢迎大家多谈谈使用感受。
 
WordConcordancer

  Step One: Find [Macro] from the dropdown menu [Tools]; and key in FindText as the Macro name, then click [Create] to start a new Macro.
  
Step Two: Clear all the codes in the popup VisualBasic Editor window and paste the following codes exactly as it is into the VisualBasic Editor window.

Sub FindText()
Text = InputBox("Type in any word or word string in the input box below", "Corpus4u_Word_Concord!")
With Activedocument.Content.Find
Do While .Execute(FindText:=Text) = True
tim = tim + 1
Loop
End With
MsgBox ("In the current text I have found " + Str(tim) + " instance(s) of " + Text), 48, "Search_Result"
End Sub

 
  Step Three: Save and close the VB Editor to return Microsoft Word
  
  Step Four: Find [Customize] from the dropdown menu [Tools]; click [Command] and find [Macro], you will a macro named “Normal.NewMacros.FindText”. Then drag the macro and drop onto anywhere on the Format Toolbar. Finally rename the macro by right-clicking the button, and change “Normal.NewMacros.FindText” to “WordConcord” or any other name.

  You can get the frequency of a key word or word string in the opened text by clicking the button, entering the key word.

Done.
 
真是强啊,以前从一位研究古代汉语的博士那里听说过,今天确真的出现了.
向逍遥浪子和许博士致敬!!!
 
要仅仅需要统计文本(不管是什么语言)的出现的频次,其实也有更简单的方法, 用文本编辑器ultraedit的搜索功能,一下子就把次数显示出来了...
 
回复:用WORD统计文本出现次数WordConcordancer

以下是引用 dzhigner2005-7-22 17:25:29 的发言:
要仅仅需要统计文本(不管是什么语言)的出现的频次,其实也有更简单的方法, 用文本编辑器ultraedit的搜索功能,一下子就把次数显示出来了...

谢谢dzhigner的信息。
 
回复:用WORD统计文本出现次数WordConcordancer

以下是引用 dzhigner2005-7-22 17:19:15 的发言:
我就是无产者中的一员。我的武器是Visual Basic 和Excel

dzhigner正是我最欣赏的那种人。你的Excel水平之前早有领教,只是我底子很差,消化起来还有些困难。

dzhigner你VB很好,能不能教C友们如何在word里添加一个工具条,用以进行手工语料标注。
就像下面的李文中的例子。

2005072220572662.jpg
 
回复:用WORD

问一个初级问题:什么是“文本出现次数”?A word list with frequency information of each word in the text?
 
No word list can be generated.
It basically utilizes the search function of Windows. This so-called WordConcordancer only counts the ocurrences (ie: frequency) of the key word you enter.

As mentioned in dzhigner's reply, UltraEdit does this as well.
2005072300444722.jpg
 
回复:用WORD统计文本出现次数WordConcordancer

以下是引用 xujiajin2005-7-22 20:50:53 的发言:
以下是引用 dzhigner2005-7-22 17:19:15 的发言:
我就是无产者中的一员。我的武器是Visual Basic 和Excel

dzhigner正是我最欣赏的那种人。你的Excel水平之前早有领教,只是我底子很差,消化起来还有些困难。

dzhigner你VB很好,能不能教C友们如何在word里添加一个工具条,用以进行手工语料标注。
就像下面的李文中的例子。

您过奖了。。。。。。而且,这个任务我也完不成,做这个需要VBA(visual basic for application),VBA 和Visual Basic 其实在开发环境方面不一样,我一点都不通。
 
回复:用WORD统计文本出现次数

Simple frequency information and word list can be obtained by using
a text processor called NoteTab Light, which is free from

http://www.notetab.com/

From Tools - Text Statistics, you can get a word list, frequency and
percentage information of each of the words in the text:

2005072305082348.jpg


NoteTab also has a nice feature called Clipbook, which can be used for
semi-automated text tagging. For example, one can use it to
facilitate the marking of such discourse pragmatic properties as
information status, gender, anaphora and so forth. Of course the
program doesn't know any of these things, but it can help you avoid
typing the markers repetitatively.
 
既然你有ultraedit, 那我给你介绍一能省些事的方法吧,不过还是李文中先生制作的工具实用。
ultraedit 的视图(view)菜单里有个Tag List 功能,按Ctrl+F8能出现,ultraedit 所在文件夹下有一个名字是Taglist.txt的文本文件,按格式加入需要的tag set 就可以在ultraedit里使用了。。这个方法适用于规模不太大的tag set.

ultraEdit 是我最喜欢的字处理器,仔细学一下就会发现它功能真的很强大。最独特的功能是它有一个Column mood (栏模式),这个功能简直太有用了。。。。居然可以这样选择文本。。。
2005072305120858.jpg



不过,它对中文的支持不是很稳定(如果不是UTF-8编码)。。。
 
It is very interesting to try the above techniques. Howerver, it seems you do not have to bother yourself if you are as lazy as me. Under MS Word 2003, you may use FIND to count the frequency of a specific sequence. Here is the Snapscreen.
2005072311182598.jpg
 
回复:用WORD统计文本出现次数WordConcordancer

以下是引用 dzhigner2005-7-23 5:16:24 的发言:


ultraEdit 是我最喜欢的字处理器,仔细学一下就会发现它功能真的很强大。最独特的功能是它有一个Column mood (栏模式),这个功能简直太有用了。。。。居然可以这样选择文本。。。

Many text editors have this function. Even in MS Word, you can
hold the ALT while using your mouse to highlight a Column (栏).
 
对,按下Alt然后再用鼠标选择,这在WORD中叫“矩形选择”,因为它可以选中任何一个矩形区域。
 
回复:用WORD统计文本出现次数WordConcord

VB很棒啊!但需要这么复杂吗?-:) 用成熟的concordancer会更理想,如Watt的Concordance等,有frequency还有kwic。
 
回复:用WORD统计文本出现次数WordConcord

以下是引用 xusun5752005-8-1 18:20:11 的发言:
VB很棒啊!但需要这么复杂吗?-:) 用成熟的concordancer会更理想,如Watt的Concordance等,有frequency还有kwic。

没错。不过这里提供的是给无产阶级的。Watt的Concordance等目前还不属于无产阶级。
 
Back
顶部