Closed BeckySharp closed 3 years ago
There can be multiple ways to enable and disable things, but one runtime possibility had been accounted for. Code would look approximately like this:
val eidosSystem = {
val config = ConfigFactory.load(EidosSystem.defaultConfig)
val componentOpts = new ComponentOpts(eidosSentenceClassifier = false)
val components = new ComponentsBuilder(config, EidosSystem.PREFIX, componentOpts = componentOpts).build()
new EidosSystem(components)
}
It was so that each component didn't need to have its own enabled/disabled setting in the conf file, a setting that probably wouldn't work for other tests or configurations. Then we also don't need to edit the config in memory and don't need to reload the components each time. They can also be filtered from existing components, like
val componentOpts = new ComponentOpts(eidosSentenceClassifier = false)
val newEidosSystem = new EidosSystem(oldEidosSystem.components.filter(componentOpts))
Maybe that would help, maybe not.
yeah, but the disadvantage of that is that it's in code, vs being able to set things up outside of code. I think just about everything else is disableable in the config right?
also @kwalcock and @MihaiSurdeanu if you choose not to merge this, ping me so I change what I wrote in the wiki. (Though i vote for including it....) :)
I saw this but can't look at it yet :-(
I saw this but can't look at it yet :-(
no worries! you work too much as it is!
@BeckySharp, you have convinced me, which is no easy feat :-) However, I'm going to move the functionality to SentenceClassifier because it should know how to enable/disable itself and not need to pass that responsibility to the tests. The PR will be ready shortly.
Unless there's already a way...