Ejemplo n.º 1
0
        /// <summary>
        /// Constructor.  Reads the file and stores any data needed for corrections later on.
        /// </summary>
        public FwDataFixer(string filename, IProgress progress, ErrorLogger logger, ErrorCounter counter)
        {
            m_filename   = filename;
            m_progress   = progress;
            errorLogger  = logger;
            errorCounter = counter;

            m_progress.Minimum  = 0;
            m_progress.Maximum  = 1000;
            m_progress.Position = 0;
            m_progress.Message  = String.Format(Strings.ksReadingTheInputFile, m_filename);
            m_crt = 0;
            // The following fixers will be run on each rt element during FixErrorsAndSave()
            // Note: every change to the file MUST log an error. This is used in FixFwData to set a return code indicating whether anything changed.
            // This in turn is used in Send/Receive to determine whether we need to re-split the file before committing.
            // N.B.: Order is important here!!!!!!!
            m_rtLevelFixers.Add(new DuplicateStyleFixer());
            m_rtLevelFixers.Add(new OriginalFixer());
            m_rtLevelFixers.Add(new CustomPropertyFixer());
            m_rtLevelFixers.Add(new BasicCustomPropertyFixer());
            var senseFixer = new GrammaticalSenseFixer();

            m_rtLevelFixers.Add(senseFixer);
            m_rtLevelFixers.Add(new MorphBundleFixer(senseFixer));             // after we've possibly removed MSAs in GrammaticalSenseFixer
            m_rtLevelFixers.Add(new SequenceFixer());
            m_rtLevelFixers.Add(new HomographFixer());
            m_rtLevelFixers.Add(new DuplicateWordformFixer());
            m_rtLevelFixers.Add(new CustomListNameFixer());
            InitializeFixers(m_filename);
        }
Ejemplo n.º 2
0
 public MorphBundleFixer(GrammaticalSenseFixer senseFixer)
 {
     m_senseFixer = senseFixer;
 }