The last of Scala's control constructs you'll learn about today is match, which provides much of Scala's pattern-matching capabilities.
今天要了解的最后一个Scala控制结构是match,它提供了许多Scala模式匹配功能。
Hint: multiple pattern-matching blocks may be necessary. (This article's code download includes one solution - but I hope you'll try it yourself before peeking.)
提示:需要使用多个模式匹配代码块(本文的代码下载中包含了一个解决方案—但是建议您在查看之前首先自己进行尝试)。
Sigil (see Resources for the website and support pages) is a WYSIWYG EPUB editor that can find the pattern-matching types of errors and allow programmers to correct them.
Sigil(参阅参考资料获取网站和支持页面)是一种WYSIWYGEPUB编辑器,它可找到模式匹配类型的错误,并且允许程序员更正它们。
In this paper, a quantitative analysis of error factors for pattern-matching guidance is performed.
本文对图像匹配制导的误差因素作了定量分析。
The traditional methods of NLI designing include pattern-matching, syntax analysis, semantic grammar, and intermediate representation languages.
自然语言接口设计的传统方法包括模板匹配、句法分析、语义语法和中间表述语言等。
The essay proposed, in the following section, a pattern-matching system based on these PMEs, and introduced the system architecture, bus structure, data interface, and etc.
在此基础上,本文给出了以上述引擎为核心的模式匹配系统,介绍了系统框架、总线结构和数据接口等内容。
In the intrusion detection algorithm based on the pattern matching, the quality of the pattern-matching algorithm has direct influence on the functions of the detection system.
在基于模式匹配的入侵检测系统中,模式匹配算法的好坏直接影响着检测系统的效能。
Listing 11 shows some basic usage of the pattern matching expansions.
清单11给出了模式匹配扩展的一些基本用法。
It USES Scala's pattern matching.
它使用Scala的模式匹配。
Assigning values to variables is actually a special type of pattern matching.
为变量赋值实际上就是一种特殊的模式匹配。
Using pattern matching to build XML.
利用模式匹配构建xml。
Our brains are just pattern matching machines, so we tend to notice patterns like that.
我们大脑是模式匹配机器,因此我们更容易注意到这样的模式。
Routes make use of regular expressions for pattern matching, and are expressed using XML.
路由在模式匹配时使用正则表达式,并且使用XML表示。
If it's not, it won't — one of the tricky things about performing pattern matching.
如果格式不好,则不会正确匹配——这是执行模式匹配任务的一件棘手之事。
There are a number of algorithms used for pattern matching by rules engines.
规则引擎可以使用多种算法执行模式匹配。
Rules to pattern matching in both these files will control what gets denied or allowed.
这两个文件中的模式匹配规则控制拒绝或允许什么。
These techniques are based on pattern matching and event definitions and can be spatial or temporal.
这些技术都是基于模式匹配和事件定义的,可以是空间上的或时间上的。
The key is pattern matching, as in Figure 1. Instead of coding commands, you code patterns.
其中的关键就是模式匹配,如图1 所示。您不需要编写命令,需要编写的是模式。
The pattern matching operation is potentially expensive, so it is vital to focus the search intelligently.
模式匹配操作可能是非常昂贵的,因此智能地集中搜索是非常重要的。
Pattern matching is a powerful and elegant way of extracting information from objects, when used appropriately.
模式匹配在使用恰当时是一个强大的,优雅的从对象中抽取信息的方式。
The key to success with a socket wrench is pattern matching: The socket must match the nut.
成功使用套筒扳手的关键在于模式匹配:套筒扳手必须与螺母相匹配。
For example, we can assign values to two variables simultaneously with one pattern matching (see Listing 31).
例如,可以使用一个模式匹配同时为两个变量赋值(参见清单31)。
In that example, pattern matching was used to extract both the head and the tail of the list.
在这个示例中,使用模式匹配提取列表的开头和结尾部分。
This article has been a quick tour of pattern matching in F# and introduced its new active patterns feature.
这篇文章是F#中模式匹配的一个快速浏览,并介绍了它的新活动模式的特性。
The idea of active patterns is to enable you to use the pattern matching syntax with other data structures.
活动模式的思想就是让你能把模式匹配语法用于其他数据结构。
This tutorial also assumes that you understand the value of developer testing and are familiar with basic pattern matching.
本教程也假设您理解开发人员测试的价值,并熟悉基本模式匹配。
Instead, consider using pattern matching for those "rare" times when you need to extract information in a controlled way.
相反地,在你需要通过可控方式获取信息的时候,考虑使用模式匹配。
Matching modes, which describe the different types of pattern matching that can be specified through the function's parameter mode.
匹配模式,描述了可以通过函数的参数MODE指定的模式匹配的不同类型。
Pattern matching is also useful for the design problem where you need to get at data inside an object, but only in special circumstances.
在你遇到需要从对象内部提取数据的设计问题时,模式匹配也有用,但是仅限一些特殊的情况。
CEP engines have sophisticated techniques for event correlation, based on pattern matching and event definitions, and might be spatial or temporal.
CEP引擎具有成熟的事件关联技术(基于模式匹配和事件定义),可以采用空间或时间模式工作。
应用推荐