示例#1
0
        internal static IEnumerable <Metadata> ReadMetadata(string file)
        {
            IEnumerable <Metadata> metadata;

            try {
                IReader <Metadata> reader = new TabSeparated();
                using (StreamReader sr = new StreamReader(File.OpenRead(file))) {
                    metadata = reader.Read(sr);
                }
            } catch (Exception ex) {
                throw new FormatException("Error reading metadata file: " + ex.Message, ex);
            }
            return(metadata);
        }
示例#2
0
        internal static IEnumerable <RelevanceEstimate> ReadEstimatedJudgments(string file)
        {
            IEnumerable <RelevanceEstimate> estimates = null;

            try {
                IReader <RelevanceEstimate> runReader = new TabSeparated();
                using (StreamReader sr = new StreamReader(File.OpenRead(file))) {
                    estimates = runReader.Read(sr);
                }
            } catch (Exception ex) {
                throw new FormatException("Error reading estimated judgments file: " + ex.Message, ex);
            }
            return(estimates);
        }
示例#3
0
        // Read files
        internal static IEnumerable <Run> ReadInputFile(string file)
        {
            IEnumerable <Run> runs = null;

            try {
                IReader <Run> runReader = new TabSeparated();
                using (StreamReader sr = new StreamReader(File.OpenRead(file))) {
                    runs = runReader.Read(sr);
                }
            } catch (Exception ex) {
                throw new FormatException("Error reading input file: " + ex.Message, ex);
            }
            return(runs);
        }
示例#4
0
 internal static IEnumerable<Metadata> ReadMetadata(string file)
 {
     IEnumerable<Metadata> metadata;
     try {
         IReader<Metadata> reader = new TabSeparated();
         using (StreamReader sr = new StreamReader(File.OpenRead(file))) {
             metadata = reader.Read(sr);
         }
     } catch (Exception ex) {
         throw new FormatException("Error reading metadata file: " + ex.Message, ex);
     }
     return metadata;
 }
示例#5
0
 internal static IEnumerable<RelevanceEstimate> ReadKnownJudgments(string file)
 {
     IEnumerable<RelevanceEstimate> judged = null;
     try {
         IReader<RelevanceEstimate> runReader = new TabSeparated();
         using (StreamReader sr = new StreamReader(File.OpenRead(file))) {
             judged = runReader.Read(sr);
         }
     } catch (Exception ex) {
         throw new FormatException("Error reading known judgments file: " + ex.Message, ex);
     }
     return judged;
 }
示例#6
0
 // Read files
 internal static IEnumerable<Run> ReadInputFile(string file)
 {
     IEnumerable<Run> runs = null;
     try {
         IReader<Run> runReader = new TabSeparated();
         using (StreamReader sr = new StreamReader(File.OpenRead(file))) {
             runs = runReader.Read(sr);
         }
     } catch (Exception ex) {
         throw new FormatException("Error reading input file: " + ex.Message, ex);
     }
     return runs;
 }