コード例 #1
0
 internal ThotWordAlignmentModel(IntPtr handle)
 {
     Handle          = handle;
     _sourceWords    = new ThotWordVocabulary(Handle, true);
     _targetWords    = new ThotWordVocabulary(Handle, false);
     _closeOnDispose = false;
 }
コード例 #2
0
 public ThotWordAlignmentModel()
 {
     Handle          = Thot.swAlignModel_create();
     _sourceWords    = new ThotWordVocabulary(Handle, true);
     _targetWords    = new ThotWordVocabulary(Handle, false);
     _closeOnDispose = true;
 }
コード例 #3
0
        public ThotWordAlignmentModel(string prefFileName, bool createNew = false)
        {
            if (!createNew && !File.Exists(prefFileName + ".src"))
            {
                throw new FileNotFoundException("The word alignment model configuration could not be found.");
            }

            _prefFileName = prefFileName;
            Handle        = createNew || !File.Exists(prefFileName + ".src")
                                ? Thot.swAlignModel_create()
                                : Thot.swAlignModel_open(_prefFileName);
            _sourceWords    = new ThotWordVocabulary(Handle, true);
            _targetWords    = new ThotWordVocabulary(Handle, false);
            _closeOnDispose = true;
        }