Mercurial > hg > openmind
annotate src/main/java/org/mpi/openmind/repository/utils/ReplacementPattern.java @ 89:8adfa8679991
new implementation of translit-to-romanization rules in RomanizationLoc with test(!).
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 26 Feb 2018 14:39:49 +0100 |
parents | aeb29e362a67 |
children |
rev | line source |
---|---|
71
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
1 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
2 * |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
3 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
4 package org.mpi.openmind.repository.utils; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
5 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
6 import java.util.regex.Pattern; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
7 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
8 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
9 * @author casties |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
10 * |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
11 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
12 public class ReplacementPattern { |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
13 public Pattern pattern; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
14 public String replacement; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
15 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
16 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
17 * @param replacement |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
18 * @param pattern |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
19 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
20 public ReplacementPattern(String replacement, Pattern pattern) { |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
21 super(); |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
22 this.pattern = pattern; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
23 this.replacement = replacement; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
24 } |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
25 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
26 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
27 * @return the pattern |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
28 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
29 public Pattern getPattern() { |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
30 return pattern; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
31 } |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
32 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
33 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
34 * @param pattern the pattern to set |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
35 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
36 public void setPattern(Pattern pattern) { |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
37 this.pattern = pattern; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
38 } |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
39 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
40 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
41 * @return the replacement |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
42 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
43 public String getReplacement() { |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
44 return replacement; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
45 } |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
46 |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
47 /** |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
48 * @param replacement the replacement to set |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
49 */ |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
50 public void setReplacement(String replacement) { |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
51 this.replacement = replacement; |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
52 } |
aeb29e362a67
New ArabicNormalizer. NormalizerUtils.normalize() now does both translit and arabic normalization.
casties
parents:
diff
changeset
|
53 } |