static InfoboxExtractorTests() { _mockedCommons = Commons.Instance; _mockedTitleParserSingle = new TitleParserSingle(_mockedCommons, new SpecialBuildingNameHelper()); string basePath = AppDomain.CurrentDomain.BaseDirectory; input_Bakery = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "input_Bakery.txt")); result_Bakery = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "result_Bakery.infobox")); input_Bank = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "input_Bank.txt")); result_Bank = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "result_Bank.infobox")); input_Fishery = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "input_Fishery.txt")); result_Fishery = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "result_Fishery.infobox")); input_Hospital = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "input_Hospital.txt")); result_Hospital = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "result_Hospital.infobox")); input_Lumberjack = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "input_Lumberjack's_Hut.txt")); result_Lumberjack = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "result_Lumberjack's_Hut.infobox")); input_Sawmill = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "input_Sawmill.txt")); result_Sawmill = File.ReadAllText(Path.Combine(basePath, "Testdata", "Extractor", "result_Sawmill.infobox")); }
public InfoboxExtractor(ICommons commonsToUse, ITitleParserSingle titleParserSingleToUse) { _commons = commonsToUse; _titleParserSingle = titleParserSingleToUse; regexMultipleInfoboxes = new Regex(_commons.InfoboxTemplateStart, RegexOptions.Compiled); }
static InfoboxParserTests() { _mockedCommons = Commons.Instance; _mockedSpecialBuildingNameHelper = new SpecialBuildingNameHelper(); _mockedTitleParserSingle = new TitleParserSingle(_mockedCommons, _mockedSpecialBuildingNameHelper); _mockedRegionHelper = new RegionHelper(); }
public ParserSingleRegion(ICommons commons, ITitleParserSingle titleParserSingleToUse) { _commons = commons; _titleParserSingle = titleParserSingleToUse; //all numbers in the wiki are entered with comma (,) e.g. "42,21", so we need to use a specific culture for parsing (https://anno1800.fandom.com/wiki/Cannery) cultureForParsing = new CultureInfo("de-DE"); }
private InfoboxParser GetParser(ICommons commonsToUse = null, ITitleParserSingle titleParserSingleToUse = null, ISpecialBuildingNameHelper specialBuildingNameHelperToUse = null, IRegionHelper regionHelperToUse = null) { return(new InfoboxParser(commonsToUse ?? _mockedCommons, titleParserSingleToUse ?? _mockedTitleParserSingle, specialBuildingNameHelperToUse ?? _mockedSpecialBuildingNameHelper, regionHelperToUse ?? _mockedRegionHelper)); }
public InfoboxParser(ICommons commonsToUse, ITitleParserSingle titleParserSingleToUse, ISpecialBuildingNameHelper specialBuildingNameHelperToUse, IRegionHelper regionHelperToUse) { _commons = commonsToUse; _titleParserSingle = titleParserSingleToUse; _specialBuildingNameHelper = specialBuildingNameHelperToUse; _regionHelper = regionHelperToUse; parserSingleRegion = new ParserSingleRegion(_commons, _titleParserSingle); parserOldAndNewWorld = new ParserOldAndNewWorld(_commons, _specialBuildingNameHelper, _regionHelper); parserMultipleRegions = new ParserMultipleRegions(_commons, _specialBuildingNameHelper, _regionHelper); possibleRegions_2Regions = new List <string> { "A", "B" }; possibleRegions_3Regions = new List <string> { "A", "B", "C" }; }
private IInfoboxExtractor GetExtractor(ICommons commonsToUse = null, ITitleParserSingle titleParserSingleToUse = null) { return(new InfoboxExtractor(commonsToUse ?? _mockedCommons, titleParserSingleToUse ?? _mockedTitleParserSingle)); }