All right, everyone.
So let's dive into how to create those rule-based matching packed on inside the Biton code.
And for that, I have already created a detailed notebook, so you can see.
So let us start working on it.
First, let's just look at our model.
So nothing special, nothing different here.
And to create any kinds of pattern in this rule is matching stuff you hope with first creator Metcher
object.
And this measured object is a part of spacy dark matter.
And from that, you can just import this matches.
And from that measure, you can create one match, an object.
Now, interesting thing will light while creating the pattern that we think was created while defining
different kinds of patterns here.
You can see this is called laser one pattern.
All right.
So let me run all of them.
And let me create the matter object.
All right, so let's say we want to grab.
The lower case was a..
Hello, and Voight has a pattern or a token together.
So there will be a one pattern I have defined like a hollow space.
Well, it will find out.
Or suppose you feel right.
Hello.
Well, also, it will find out or if you let's say do hello and.
One.
So Lenore Keyes was an off hand, low token and lower case was an avoid.
Easy to piece together.
The pattern underscored.
One will have to find out.
Now there is on one more pattern.
Define.
So there will be a lowercase was enough.
Hello.
And then I just kept his underscored punctuation.
Mark will be to.
So any punctuation mark exist between this lowercase was one of two pattern respectively.
Hello.
And what I really want to find out with this pattern number two.
All right.
So let me define this mode of this pattern.
And this pattern got defined as a list.
An individual element of this list will be a dictionary.
Now, as we have seen, along with I mean, apart from this Lowitt, there are a number of attributes
that are possible.
Like you can see from your land, whether you want to search for something is is Hafize contrition moggy
space like you are, in fact, hoes, entity type.
You'll see.
All right.
So I don't want to quite define next is whatever the matcher object V created V how to act both of these
packett.
So that will be a pattern in this code and pattern.
Underscore the.
Let me let me know how our pattern got defined.
We have added this pattern to the matched object.
Next is our documents should be ready.
So I've created one document where there is one HelloWallet like this.
And then you can see the one Healthway will be like this with punctuation Mark.
So let me add any.
And next steps we need to find those matches.
So we dealt for Metcher object.
We are going to apply this document, object to the match.
And it will find out all those matches.
Now, this matches will just return as the document index or kocon index number.
That will be two and a fold.
So if you see here.
Two and a four, so that will be a two.
And this will be a plea.
So that means one to two for the upper bound is always excluded.
That's why it has returned like from two to four.
They are able to find one match phone and the same way like 19 to 22.
So this is pointing to 19 then.
So Helo's pointed by 19 men under Goken will be hyphen, which is pointed by twenty twenty one is pointing
the way.
And obviously 22 will be excluded because it's an one.
Now, if you get somewhat more detailed description, you can just be true with this.
Fine, the score matches object.
So you can see and you will get a plea to place like a match already start.
So first case, we are just getting the string representation of this match.
That will be nothing but a string and a score.
Right.
And wherever the match found, the exact ping we are trying to display along with the starting next
and end index.
So if you executed.
You can see who before hello.
In here it is a 19 to 22.
Hello.
Hi, fun boy.
Let's say if you just try to act on one more Halloween, let's say in between.
Hello.
And let's say.
Hold capital.
All right.
Let me define it.
Let's find the matches.
And let's see whether it is a to identify.
Yes, it has.
It will be identified.
That means every single pattern name like this, it has its own meaning.
Take Venezuela.
The lowercase words of hello will found.
The match will be found.
All right.
So that is the one case.
Let's see one more.
So here we are defined like hallowing one just like earlier.
But one more starting the how, Heidi.
Like a puppy.
So this is going to allow the pattern to match Gedo or more this type of punctuation mark.
So suppose each any place, if that is.
No.
Nothing like some punctuation mark Xs Nanosolar.
It is a bug to identify.
So let me execute it.
And let's find a match.
And you can see it from three to five.
So this is zero.
One, two, three.
So three, two, five, one match phone.
Five six nine zero.
One, two, three, four, five, six.
Yes, six, seven and eight.
And then again, this is nine, ten, eleven.
Also quite far.
So whether any punctuation mark in between exists or not, that doesn't matter.
All right.
So that is the story behind this rule based matching.
You can go to the documentation and you will be able to see the detailed documentation regarding to
all those token attributes has been written.
What is the meaning of each individual like the law?
We have used it.
And when we tried it earlier, this entity type also we tried to digitize.
So.
So something you are searching for is lowered also.
So you can refer to this particular documentation.
And this is about the rule based matching.
Next, we will see a place mismatching.
So see you in the next video.