// import de.jollyday.configuration.ConfigurationProvider; // import java.net.MalformedURLException; // private CollectionValuedMap<String, JollyHoliday> holidays; public virtual void Init(string prefix, Properties props) { string xmlPath = props.GetProperty(prefix + "xml", "edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml"); string xmlPathType = props.GetProperty(prefix + "pathtype", "classpath"); varPrefix = props.GetProperty(prefix + "prefix", varPrefix); logger.Info("Initializing JollyDayHoliday for SUTime from " + xmlPathType + ' ' + xmlPath + " as " + prefix); Properties managerProps = new Properties(); managerProps.SetProperty("manager.impl", "edu.stanford.nlp.time.JollyDayHolidays$MyXMLManager"); try { URL holidayXmlUrl; if (Sharpen.Runtime.EqualsIgnoreCase(xmlPathType, "classpath")) { holidayXmlUrl = GetType().GetClassLoader().GetResource(xmlPath); } else { if (Sharpen.Runtime.EqualsIgnoreCase(xmlPathType, "file")) { holidayXmlUrl = new URL("file:///" + xmlPath); } else { if (Sharpen.Runtime.EqualsIgnoreCase(xmlPathType, "url")) { holidayXmlUrl = new URL(xmlPath); } else { throw new ArgumentException("Unsupported " + prefix + "pathtype = " + xmlPathType); } } } UrlManagerParameter ump = new UrlManagerParameter(holidayXmlUrl, managerProps); holidayManager = HolidayManager.GetInstance(ump); } catch (MalformedURLException e) { throw new Exception(e); } if (!(holidayManager is JollyDayHolidays.MyXMLManager)) { throw new AssertionError("Did not get back JollyDayHolidays$MyXMLManager"); } Configuration config = ((JollyDayHolidays.MyXMLManager)holidayManager).GetConfiguration(); holidays = GetAllHolidaysMap(config); }