Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.apache.ctakes.temporal.eval;
import java.util.*;
A class for splitting the THYME data into appropriate sets for evaluation.
public class THYMEData {
	public static final Set<StringSEGMENTS_TO_SKIP = Sets.newHashSet("20104""20105""20116""20138");
	public static final Set<IntegerTRAIN_REMAINDERS = Sets.newHashSet(0, 1, 2, 3);
	public static final Set<IntegerDEV_REMAINDERS = Sets.newHashSet(4, 5);
	public static final Set<IntegerTEST_REMAINDERS = Sets.newHashSet(6, 7); 
	public static List<IntegergetPatientSets(List<IntegerpatientSetsCollection<Integerremainders) {
		List<Integeritems = new ArrayList<>();
		for (Integer i : patientSets) {
			int remainder = i % 8;
			if (remainders.contains(remainder)) {
		return items;

Use getPatientSets(patientSets, TRAIN_REMAINDERS)
	public static List<IntegergetTrainPatientSets(List<IntegerpatientSets) {
		return getPatientSets(patientSets);

Use getPatientSets(patientSets, DEV_REMAINDERS)
	public static List<IntegergetDevPatientSets(List<IntegerpatientSets) {
		return getPatientSets(patientSets);

Use getPatientSets(patientSets, TEST_REMAINDERS)
	public static List<IntegergetTestPatientSets(List<IntegerpatientSets) {
		return getPatientSets(patientSets);
	public static List<FilegetFilesFor(List<IntegerpatientSetsFile rawTextDirectory) {
		if ( !rawTextDirectory.exists() ) {
			return Collections.emptyList();
		List<Filefiles = new ArrayList<>();
		for (Integer set : patientSets) {
			final int setNum = set;
			for (File file : rawTextDirectory.listFiles(new FilenameFilter(){
				public boolean accept(File dirString name) {
					return name.contains(String.format("ID%03d"setNum));
				}})) {
				// skip hidden files like .svn
				if (!file.isHidden()) {
		return files;
New to GrepCode? Check out our FAQ X