Class Matcher

java.util.regex
Class Matcher

java.lang.Object
  extended by java.util.regex.Matcher
All Implemented Interfaces:
MatchResult

public final class Matcher
   
   
    
    extends Object
   
   
   
   
    
    implements MatchResult
   
   

An engine that performs(执行) match operations(操作) on acharacter sequence byinterpreting(解释) a Pattern.

执行匹配操作在一个字符序列通过pattern

A matcher is created from a pattern by invoking(调用) the pattern'smatcher method. Once created, a matcher can be used to perform three different kinds of matchoperations:

一个matcher被创建时从一个pattern调用这pattern的matcher方法,一旦被创建,

matcher能被用执行三种不同的匹配操作

  • The matches method attempts to match the entire(全部) input sequence against the pattern.

  • The lookingAt method attempts to match the input sequence, starting at the beginning, against the pattern.

  • The find method scans the input sequence looking for the next subsequence that matches the pattern.

    matches 方法有顺序的匹配所有

    lookingAt 方法是匹配从开始到结束的匹配

    find 方法有顺序的找下一个匹配

Each of these methods returns a boolean indicating(指示) success or failure. More information about a successful match can beobtained(获得) byquerying(询问) the state of the matcher.

三个方法返回的是一个boolean表示成功或者失败。能获得许多关于成功匹配的信息

通过询问matcher

A matcher finds matches in a subset(子集) of its input called theregion(范围). By default, theregion contains all of the matcher's input. The region can bemodified(修改) via(通过) the region method and queried via theregionStart andregionEnd methods. The way that the region boundaries(周围) interact(交换) with some patternconstructs(建筑,样式) can be changed. See useAnchoringBounds anduseTransparentBounds for more details.

matcher匹配的子集在它中叫区域,默认情况下,这区域包含了所有匹配的数据。

区域能被修改用region方法和查询可以通过regionStartregionEnd 方法。

这区域的周围可以交换用一些patter样式能被改变。查看useAnchoringBounds 和useTransparentBounds更多的信息。

This class also defines(规定) methods for replacing matched subsequences with new strings whose contents can, ifdesired(渴望,想要的), be computed from the match result. TheappendReplacement andappendTail methods can be used in tandem(串联) in order to collect the result into anexisting(现有) string buffer, or the more convenientreplaceAll method can be used to create a string in which every matching subsequence in the input sequence is replaced.

这个类规定许多方法有序替换字符串用新的字符串。如果需要的话,matcher结果计算

appendReplacement 和appendTail 方法能被用来串联成集合在一个现有的字符缓冲区

更方便的replaceAll 方法能被用创建一个字符串,被替换的在每个有序匹配。

The explicit state of a matcher includes the start and end indices of the most recent successful match. It also includes the start and end indices of the input subsequence captured by eachcapturing group in the pattern as well as a total count of such subsequences. As a convenience, methods are also provided for returning these captured subsequences in string form.

匹配的成功状态包含了开始和结束的索引,它还包含了开始和结束

The explicit(明确的) state of a matcher is initially(最初的) undefined; attempting(尝试) to query any part of it before a successful match willcause(引起) anIllegalStateException to be thrown. The explicit state of a matcher isrecomputed(重新) by every match operation.

The implicit(绝对的) state of a matcher includes the input character sequence as well as theappend position, which isinitially zero and is updated by theappendReplacement method.

这matcher最初是未定义的,尝试查询任何部分在匹配成功之前将引起一个IllegalStateException 抛出

明确的匹配是重新每个匹配操作。

matcher的绝对匹配包含字符串顺序输入和追加位子。最初由0开始和更新通过appendReplacement 方法。

A matcher may be reset explicitly(明白的,正确的) by invoking itsreset() method or, if a new input sequence isdesired(想得到), itsreset(CharSequence) method. Resetting a matcher discards(不使用) its explicit state information and sets the append position to zero.

Instances of this class are not safe for use by multiple concurrent threads. 

mathcher匹配正确通过它的reset方法或者,假如需要一个新的输入序列,

它的reset(CharSequence)方法,重新的一个匹配将丢弃和设置这位子为0

这个类的实例不是安全的通过多线程使用。

深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值