File tree Expand file tree Collapse file tree
ImportStudentStep/source/edu/cmu/pslc/learnsphere/imports/studentstep Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ protected void runComponent() {
5858 * @param inputFile the File
5959 * @throws failure to verify the file will throw an exception
6060 */
61- private void verifyInputFile (File inputFile )
61+ private void verifyInputFile (File inputFile )
6262 throws Exception
6363 {
6464 File shortFile = null ;
@@ -96,7 +96,7 @@ private void verifyInputFile(File inputFile)
9696 /*
9797 * Regex for KCM names... the name will be in group(2).
9898 */
99- private static final Pattern KCM_PATTERN = Pattern .compile ("(KC \\ ()(.*) \\ )" );
99+ private static final Pattern KCM_PATTERN = Pattern .compile ("(?i) \\ s*KC \\ s* \\ (.* \\ )\\ s* " );
100100
101101 /**
102102 * Method to determine what KC models are present in the input file.
@@ -118,10 +118,9 @@ private List<String> getKCModelNames(File inputFile)
118118 String line = null ;
119119 if ((line = br .readLine ()) != null ) {
120120 for (String header : line .split ("\t " )) {
121- Matcher m = KCM_PATTERN .matcher (header );
122- while (m .find ()) {
123- result .add (m .group (2 ));
124- }
121+ String modelName = this .getOptionAsString ("model" )
122+ .replaceAll ("(?i)\\ s*KC\\ s*\\ ((.*)\\ )\\ s*" , "$1" );
123+ result .add (modelName );
125124 }
126125 }
127126 } catch (Exception e ) {
You can’t perform that action at this time.
0 commit comments