Codebase list libjuniversalchardet-java / e20ac06
Import upstream version 2.4.0+git20210320.1.92a12d8 Debian Janitor 2 years ago
7 changed file(s) with 117 addition(s) and 62 deletion(s). Raw diff Collapse all Expand all
0 # This workflow will build a Java project with Maven
1 # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
2
3 name: juniversalchardet CI
4 on:
5 push:
6 branches: [ '*' ]
7 pull_request:
8 branches: [ '*' ]
9
10 jobs:
11 build:
12 runs-on: ubuntu-latest
13 strategy:
14 matrix:
15 java: [ 8, 11, 15 ]
16 name: Java ${{matrix.java}}
17 steps:
18 - uses: actions/checkout@v2
19 - name: Setup java
20 uses: actions/setup-java@v1
21 with:
22 java-version: ${{matrix.java}}
23 - name: Build with Maven
24 run: mvn -B -Dgpg.skip=true -Dmaven.javadoc.skip=true clean package verify
+0
-12
.travis.yml less more
0 language: java
1
2 dist: trusty
3
4 install: mvn install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true
5
6 jdk:
7 - openjdk7
8 - openjdk8
9 - openjdk9
10 - openjdk10
11 - openjdk11
33 <modelVersion>4.0.0</modelVersion>
44 <groupId>com.github.albfernandez</groupId>
55 <artifactId>juniversalchardet</artifactId>
6 <version>2.4.0</version>
6 <version>2.4.1-SNAPSHOT</version>
77 <url>https://github.com/albfernandez/juniversalchardet</url>
88 <packaging>jar</packaging>
99 <name>juniversalchardet</name>
152152
153153 <profiles>
154154 <profile>
155 <id>jdk7on</id>
155 <id>jdk7</id>
156156 <activation>
157 <jdk>(,1.8]</jdk>
157 <jdk>(,1.7]</jdk>
158158 </activation>
159159 <build>
160160 <plugins>
188188 </build>
189189 </profile>
190190 <profile>
191 <id>jdk9on</id>
191 <id>jdk8</id>
192192 <activation>
193 <jdk>[9,)</jdk>
193 <jdk>1.8</jdk>
194194 </activation>
195195 <build>
196196 <plugins>
197197 <plugin>
198198 <groupId>org.apache.maven.plugins</groupId>
199199 <artifactId>maven-compiler-plugin</artifactId>
200 <version>3.8.1</version>
201 <executions>
202 <execution>
203 <id>default-compile</id>
204 <configuration>
205 <release>${compiler.module.level}</release>
206 </configuration>
207 </execution>
208 <execution>
209 <id>base-compile</id>
210 <goals>
211 <goal>compile</goal>
212 </goals>
213 <configuration>
214 <excludes>
215 <exclude>module-info.java</exclude>
216 </excludes>
217 </configuration>
218 </execution>
219 </executions>
220 <configuration>
200 <version>3.7.0</version>
201 <configuration>
202 <excludes>
203 <exclude>module-info.java</exclude>
204 </excludes>
221205 <source>${compiler.level}</source>
222206 <target>${compiler.level}</target>
223207 </configuration>
257241 </plugins>
258242 </build>
259243 </profile>
244 <profile>
245 <id>jdk9on</id>
246 <activation>
247 <jdk>[9,)</jdk>
248 </activation>
249 <build>
250 <plugins>
251 <plugin>
252 <groupId>org.apache.maven.plugins</groupId>
253 <artifactId>maven-compiler-plugin</artifactId>
254 <version>3.8.1</version>
255 <executions>
256 <execution>
257 <id>default-compile</id>
258 <configuration>
259 <release>${compiler.module.level}</release>
260 </configuration>
261 </execution>
262 <execution>
263 <id>base-compile</id>
264 <goals>
265 <goal>compile</goal>
266 </goals>
267 <configuration>
268 <excludes>
269 <exclude>module-info.java</exclude>
270 </excludes>
271 </configuration>
272 </execution>
273 </executions>
274 <configuration>
275 <source>${compiler.level}</source>
276 <target>${compiler.level}</target>
277 </configuration>
278 </plugin>
279 <plugin>
280 <groupId>com.github.spotbugs</groupId>
281 <artifactId>spotbugs-maven-plugin</artifactId>
282 <version>${version.spotbugs-maven-plugin}</version>
283 <configuration>
284 <effort>Max</effort>
285 <threshold>Medium</threshold>
286 <includeTests>false</includeTests>
287 <failOnError>false</failOnError>
288 <plugins>
289 <plugin>
290 <groupId>com.h3xstream.findsecbugs</groupId>
291 <artifactId>findsecbugs-plugin</artifactId>
292 <version>${version.findsecbugs-plugin}</version>
293 </plugin>
294 <plugin>
295 <groupId>com.mebigfatguy.sb-contrib</groupId>
296 <artifactId>sb-contrib</artifactId>
297 <version>${version.sb-contrib}</version>
298 </plugin>
299 </plugins>
300 </configuration>
301 <executions>
302 <execution>
303 <id>spotbugs-check</id>
304 <phase>verify</phase>
305 <goals>
306 <goal>check</goal>
307 </goals>
308 </execution>
309 </executions>
310 </plugin>
311 </plugins>
312 </build>
313 </profile>
260314
261315 </profiles>
262316
3636
3737 package org.mozilla.universalchardet.prober.distributionanalysis;
3838
39 public class EUCKRDistributionAnalysis extends CharDistributionAnalysis
40 {
39 public class EUCKRDistributionAnalysis extends CharDistributionAnalysis {
4140 ////////////////////////////////////////////////////////////////
4241 // constants
4342 ////////////////////////////////////////////////////////////////
5150 ////////////////////////////////////////////////////////////////
5251 // methods
5352 ////////////////////////////////////////////////////////////////
54 public EUCKRDistributionAnalysis()
55 {
53 public EUCKRDistributionAnalysis() {
5654 super();
5755 this.typicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO;
5856 this.charToFreqOrder = euckrCharToFreqOrder;
5957 }
6058
6159 @Override
62 protected int getOrder(final byte[] buf, int offset)
63 {
60 protected int getOrder(final byte[] buf, int offset) {
6461 int highbyte = buf[offset] & 0xFF;
6562 if (highbyte >= HIGHBYTE_BEGIN) {
6663 int lowbyte = buf[offset+1] & 0xFF;
3636
3737 package org.mozilla.universalchardet.prober.sequence;
3838
39 public class CyrillicModel extends SequenceModel
40 {
39 public class CyrillicModel extends SequenceModel {
4140 ////////////////////////////////////////////////////////////////
4241 // constants
4342 ////////////////////////////////////////////////////////////////
4746 ////////////////////////////////////////////////////////////////
4847 // methods
4948 ////////////////////////////////////////////////////////////////
50 public CyrillicModel(short[] charToOrderMap, String name)
51 {
49 public CyrillicModel(short[] charToOrderMap, String name) {
5250 super(
5351 charToOrderMap,
5452 russianLangModel,
5353 ////////////////////////////////////////////////////////////////
5454 // methods
5555 ////////////////////////////////////////////////////////////////
56 public Big5SMModel()
57 {
56 public Big5SMModel() {
5857 super(
5958 new PkgInt(INDEX_SHIFT_4BITS, SHIFT_MASK_4BITS, BIT_SHIFT_4BITS, UNIT_MASK_4BITS, big5ClassTable),
6059 BIG5_CLASS_FACTOR,
3636
3737 package org.mozilla.universalchardet.prober.statemachine;
3838
39 public class CodingStateMachine
40 {
39 public class CodingStateMachine {
4140 protected SMModel model;
4241 protected int currentState;
4342 protected int currentCharLen;
4443 protected int currentBytePos;
4544
46 public CodingStateMachine(SMModel model)
47 {
45 public CodingStateMachine(SMModel model) {
4846 this.model = model;
4947 this.currentState = SMModel.START;
5048 }
5149
52 public int nextState(byte c)
53 {
50 public int nextState(byte c) {
5451 int byteCls = this.model.getClass(c);
5552 if (this.currentState == SMModel.START) {
5653 this.currentBytePos = 0;
6360 return this.currentState;
6461 }
6562
66 public int getCurrentCharLen()
67 {
63 public int getCurrentCharLen() {
6864 return this.currentCharLen;
6965 }
7066
71 public void reset()
72 {
67 public void reset() {
7368 this.currentState = SMModel.START;
7469 }
7570
76 public String getCodingStateMachine()
77 {
71 public String getCodingStateMachine() {
7872 return this.model.getName();
7973 }
8074 }