An urn model with local reinforcement: a theoretical framework for a chi-squared goodness of fit test with a big sample