如果对于一些单词,你拼写出错较为频繁,制作一份单词清单吧。
If there are certain words you have already identified that you misspell frequently, make yourself a spelling list.
制作一份易错词汇列表。如果对于一些单词,你拼写出错较为频繁,制作一份单词清单吧。
Make yourself a list of problem words. If there are certain words you have already identified that you misspell frequently, make yourself a spelling list.
然后您可以迭代通过这些条目,从条目中解析出一系列单词,如 清单1 所示。
You can then iterate through the entries and parse the list of words out of the entry, as in Listing 1.
清单1提供了一个完整的示例,该示例将在特定文件中查找从命令行作为输入而传入的最长单词。
Listing 1 provides a complete example by looking for the longest word in a particular file passed in from the command line as input.
要填充文件,可循环通过单词映射中的值,将每个值写到文件中的一行(参见清单4)。
To populate the file, loop through the values in your word map, writing each to a row in your file (see Listing 4).
清单3展示了相同的代码,但是添加了测试单词字符串长度和频率的逻辑。
Listing 3 shows the same code with logic added that tests for word string length and frequency.
清单5展示了添加的逻辑,它进行检查以确定单词是否包含在任何被认为重要的元素中。
Listing 5 shows the added logic, which checks to determine whether the word is contained in any elements deemed important.
在清单6所示的文件中,这个命令会找到第10行的第一个单词。
In the file shown in Listing 6, this command would find the first word on line 10.
在清单6所示的文件中,这个命令会找到第6行的第一个单词。
In the file shown in Listing 6, this command would find the first word on line 6.
这个命令会找到清单6所示文件的第3行的第一个单词。
This command would find the first word on line 3 in the file shown in Listing 6.
另一方面,客户机返回句子中的单词数量,如清单4中所示。
The client, on the other hand, returns the number of words in the sentence, as in Listing 4.
例如,可以通过清单2内所示的命令搜索单个单词。
For example, you can search for a single word using the command in Listing 2.
让我们使用为纵横字谜助手创建的一些代码,创建从一个单词生成单词链的脚本(参见清单12)。
Let's create a script to generate word chains from a single word, using some of the code we created for the crossword helper (see Listing 12).
创建一个新单词的语义是一个不匹配任何查询模式并且包含一个参数清单的消息。
The semantics for creating a new word is a message that doesn't match any query patterns and which contains a parameter list.
LIWC将文本模板与内置字典作对照,几秒钟内即可提供每个组别的单词数量清单。
LIWC compares a text sample to its dictionary and, within seconds, provides a readout of how many words appear in each category.
可以使用非常类似于清单1的代码来分隔单词。
A code very similar to the code shown in Listing 1 can be used to parse the names which USES underscores to separate words.
清单7 中显示的下个查询的意思为“查找单词'bear'表示的概念,并查找这些概念的词汇条目”。
The next query, shown in Listing 7, says "find concepts represented by the word 'bear' and find the glossary entries for those concepts."
例如,限制示例序列化使其只包括含有 night单词的标题,如 清单8 所示,这只需序列化完整数据所用的时间的 60%。
For example, limiting the sample serialization to include only titles containing the word night, as in Listing 8, takes 60 percent of the time to serialize the full set.
清单1展示了如何传输echo的输出,以对一个小的单词列表进行分类。
Listing 1 shows how to pipe the output of echo to sort a small list of words.
最好再试一下:清单6会考虑单词中任何可能出现在th之前的字母。
Better try again: Listing 6 takes into account any letters in the words that might come before the th.
清单5是接受一个单词然后用Python集合返回下义词链的客户机代码。
Listing 5 is client code that takes a word and returns the hyponym chain as a Python set.
清单9中的删除逻辑是灵活的,因为我允许使用remove或者delete后面加单词的命令。
The remove logic in Listing 9 is flexible, because I allow the command to be remove or delete followed by the word.
清单12是使用我们的text1文件的基础例子,它包含3个行,每行只有两个单词。
Listing 12 is a basic example using our text1 file, which contains three lines each having two words..
假定希望输出测试文件中包含字符串th 的所有单词,则构建清单5 中所示的regexp 进行此工作。
Say you want to output all the words in the test file containing the string th, and you've built the regexp shown in Listing 5 to do that.
图1是运行清单1中的Web服务器并浏览页面以查找单词“code”时的结果。
Figure 1 is what you see when the Web server in Listing 1 is running and you browse to the page for the word "code".
举例而言,在清单4中,我想验证对某个给定单词返回了其正确定义并放入一个输出Label中。
For example, in Listing 4, I want to verify that the correct definition is returned and placed into an output Label for a given word.
清单1 (wnserver . py)是使用CherryPy根据非常简单的URL方案提供单词信息的程序。
Listing 1 (wnserver.py) is a program that USES CherryPy to serve up information about words based on a very simple URL scheme.
清单8中显示了另一个示例,查找其他两个单词的上位词(母词)。
A more involved example, shown in Listing 8, finds the hypernym (parent word) of two others.
努力寻找英语重点单词的清单(如“videogames”)并且在选择的区域去测试同类产品的市场情况。
Brainstorm your list of English keywords (for instance, 'videogames') and select your region to test the traffic for its local equivalents.
清单4.测试一个极端例子:如果有人没有输入单词就按下了按钮该怎么办?
Listing 4. Testing an edge case: What if someone presses the button without typing in a word?
应用推荐