2
# Licensed to the Apache Software Foundation (ASF) under one or more
3
# contributor license agreements. See the NOTICE file distributed with
4
# this work for additional information regarding copyright ownership.
5
# The ASF licenses this file to You under the Apache License, Version 2.0
6
# (the "License"); you may not use this file except in compliance with
7
# the License. You may obtain a copy of the License at
9
# http://www.apache.org/licenses/LICENSE-2.0
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
18
# This is an example of rule tailoring for Hebrew.
19
# In this example the single-quote is added to the Extend category
20
# The double-quote is added to the MidLetter category.
23
$CR = [\p{Word_Break = CR}];
24
$LF = [\p{Word_Break = LF}];
25
$Newline = [\p{Word_Break = Newline}];
26
$Extend = [\p{Word_Break = Extend}\u0027];
27
$Format = [\p{Word_Break = Format}];
28
$ALetter = [\p{Word_Break = ALetter}];
29
$MidNumLet = [\p{Word_Break = MidNumLet}];
30
$MidLetter = [\p{Word_Break = MidLetter}\u0022];
31
$MidNum = [\p{Word_Break = MidNum}];
32
$Numeric = [\p{Word_Break = Numeric}];
33
$ExtendNumLet = [\p{Word_Break = ExtendNumLet}];
34
$dictionary = [:LineBreak = Complex_Context:];
35
$Control = [\p{Grapheme_Cluster_Break = Control}];
36
$ALetterPlus = [$ALetter [$dictionary-$Extend-$Control]];
38
$ALetterEx = $ALetterPlus ($Extend | $Format)*;
39
$MidNumLetEx = $MidNumLet ($Extend | $Format)*;
40
$MidLetterEx = $MidLetter ($Extend | $Format)*;
41
$MidNumEx = $MidNum ($Extend | $Format)*;
42
$NumericEx = $Numeric ($Extend | $Format)*;
43
$ExtendNumLetEx = $ExtendNumLet ($Extend | $Format)*;
48
[^$CR $LF $Newline]? ($Extend | $Format)+;
51
$ALetterEx $ALetterEx {200};
52
$ALetterEx ($MidLetterEx | $MidNumLetEx) $ALetterEx {200};
53
$NumericEx $NumericEx {100};
54
$ALetterEx $NumericEx {200};
55
$NumericEx $ALetterEx {200};
56
$NumericEx ($MidNumEx | $MidNumLetEx) $NumericEx {100};
57
$ALetterEx $ExtendNumLetEx {200};
58
$NumericEx $ExtendNumLetEx {100};
59
$ExtendNumLetEx $ExtendNumLetEx {200};
60
$ExtendNumLetEx $ALetterEx {200};
61
$ExtendNumLetEx $NumericEx {100};