public string Encode(string inputFilePath, Track track, ITagger tagger) { if (string.IsNullOrWhiteSpace(inputFilePath)) { throw new ArgumentNullException("inputFilePath"); } if (track == null) { throw new ArgumentNullException("track"); } if (tagger == null) { throw new ArgumentNullException("tagger"); } var outputFilePath = BuildOutputFilePath(track); string buildArgsFunc = _buildArgsFunc(inputFilePath, outputFilePath, _quality); var encoderCmd = new CommandLineRunner(buildArgsFunc); encoderCmd.Run(); if (encoderCmd.ExitCode != 0) { throw new CommandLineOperationException(encoderCmd.StandardError, encoderCmd.ExitCode); } tagger.Tag(outputFilePath, track); return(outputFilePath); }
public static Dictionary <string, object[]> Tag(string tagName, Sentence sentence) { if (!IsTagRegistered(sentence.Locale, tagName)) { throw new InvalidOperationException("No tagger is registered for tag-name: " + tagName); } ITagger tagger = s_taggers[sentence.Locale][tagName.ToLower()]; return(tagger.Tag(sentence)); }
public void Tag(Sentence sentence) { _tagger.Tag(sentence, _options); }