示例#1
0
        public LookupResolver(CultureMapper cultureMapper)
        {
            if (cultureMapper == null)
            {
                throw new ArgumentNullException();
            }

            _cultureMapper          = cultureMapper;
            _normalizeTopicDelegate = NormalizeTopicOmitChecks;
        }
示例#2
0
        public LookupManager(Playlist playlist, CultureMapper cultureMapper)
        {
            // precondition checking
            if (playlist == null || cultureMapper == null)
            {
                throw new ArgumentNullException();
            }

            _cultureMapper  = cultureMapper;
            _playlist       = playlist;
            _quoteCollector = new QuoteCollector(playlist, cultureMapper);

            RegisterQuoteCollectorEventHandler();
        }
示例#3
0
        public QuoteCollector(Playlist playlist, CultureMapper cultureMapper)
        {
            // checking preconditions
            if (playlist == null || cultureMapper == null)
            {
                throw new ArgumentNullException();
            }

            _playlist      = playlist;
            _cultureMapper = cultureMapper;
            _parsePageContentsAndExtractQuotes = ParsePageContentsAndExtractQuotes;
            _extractTopicTranslationsDelegate  = ExtractTopicTranslations;
            _topicTranslationsRegex            = CompileRegex(cultureMapper.ToList(), TopicTranslationRegexPattern, RegexOptions.ExplicitCapture);
        }