Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native as YML #3

Open
moonglum opened this issue Oct 20, 2012 · 5 comments
Open

Native as YML #3

moonglum opened this issue Oct 20, 2012 · 5 comments
Labels

Comments

@moonglum
Copy link
Contributor

Maybe it also makes sense to make the natives YMLs. The Native would be a class initialized with the content of a YML file.
It would contain:

  • A list of common indications of being a streetname for the language
  • It would contain the Regular Expressions from the class to determine if it is a ZIP code etc.
  • Possibly it would need an additional Regular Expression to determine the city name as in is_city?

What do you think?

@bitboxer
Copy link
Contributor

I am not sure if it is possible to put all the logic in YML. Maybe there will be stuff that needs code to determine the language ...but we can give it a try

@moonglum
Copy link
Contributor Author

You mean currently or in the future?

@bitboxer
Copy link
Contributor

In the future.

@moonglum
Copy link
Contributor Author

Yeah, possibly. I think we should try it for now, if we see that the requirements change in the future: We can still change it than :)

@rjz
Copy link
Contributor

rjz commented Oct 20, 2012

One thought might be to move the parse method out of setup and into to a base class that a language processor (possibly the native class?) would then derive from. For instance,

module Native
  class NativeLanguage
    def parse
      # ...
    end
  end

  class De < NativeLanguage
    # ...
  end
end

The base parse method would handle YML, CSV, or whatever other data format is settled on, but the child class would then have an opportunity to either override it entirely or modify the parsed data with its own logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants