Пример #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;
 }