Skip to content

Commit

Permalink
Posix bracket property lookup is case insensitive now.
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex committed Feb 22, 2012
1 parent a48282b commit fb46ea4
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions src/org/jcodings/constants/PosixBracket.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,10 @@
*/
package org.jcodings.constants;

import org.jcodings.util.BytesHash;
import org.jcodings.util.CaseInsensitiveBytesHash;

public class PosixBracket{

public static final byte[][] PBSNamesUpper = {
"Alnum".getBytes(),
"Alpha".getBytes(),
"Blank".getBytes(),
"Cntrl".getBytes(),
"Digit".getBytes(),
"Graph".getBytes(),
"Lower".getBytes(),
"Print".getBytes(),
"Punct".getBytes(),
"Space".getBytes(),
"Upper".getBytes(),
"XDigit".getBytes(),
"ASCII".getBytes(),
"Word".getBytes()
};

public static final byte[][] PBSNamesLower = {
"alnum".getBytes(),
"alpha".getBytes(),
Expand Down Expand Up @@ -74,10 +57,10 @@ public class PosixBracket{
CharacterType.WORD,
};

public static final BytesHash<Integer> PBSTableUpper = new BytesHash<Integer>(15);
public static final CaseInsensitiveBytesHash<Integer> PBSTableUpper = new CaseInsensitiveBytesHash<Integer>(PBSNamesLower.length + 5);

static {
for (int i=0; i<PBSValues.length; i++) PBSTableUpper.put(PBSNamesUpper[i], PBSValues[i]);
for (int i=0; i<PBSValues.length; i++) PBSTableUpper.put(PBSNamesLower[i], PBSValues[i]);
}

}

0 comments on commit fb46ea4

Please sign in to comment.