adding custom attribute to doc, having NER use attribute

Can you please respond to this question as no matter what I do it won't matter if I can't get this bit going.
I think I just need more explicit instructions - how/where to set Language.factories, and does my class need a to_disk method?