W dniu 2014-04-05 10:46, Daniel Naber pisze:
> On 2014-04-05 03:29, Andriy Rysin wrote:
>
>> Here's the patch for the solution that I think should be acceptable:
>> for
>> multiple grammar files when validating we extract all unification
>> elements from the first file and prepend them to the rest of the files.
>
> I think that's okay. It still means we're shipping XML files that are
> not validating and that XML editors will complain about them, but I have
> no better solution either.

Well, I think we may document this on our wiki so that people would know 
the implications of using multiple rule files.

Another solution is to define unification outside rule files, in a 
separate file. This seems to be a bit cleaner, though there will be no 
validation on IDs then (validating them in pure XML would involve 
inclusions and exclusions, which creates unnecessary complexity), so 
then we should drop IDs and use any other attribute in XML. Instead, we 
might

(1) restrict the unification attribute values in the Schema, using the 
namespaces to get country-specific values, or

(2) check the attributes in the XML rule loader, which should already 
know the attribute values and complain if they are not correct.

Overall, I think the gain from validating IDs in unification is very 
small, and we don't even have to move unification to a separate file if 
we use solution (2), which should be very easy to implement. Right now 
the unknown ID causes NPE in Unifier.isSatisfied().

I am leaning towards moving unification to a separate file and using the 
rule loader to check the values. This should make it easier to use 
unification in the rule editor online as well - the unification file 
could be simply loaded beforehand, just like disambiguation.

Regards,
Marcin

------------------------------------------------------------------------------
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to