Giter Club home page Giter Club logo

food-fish-parser-ruby's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

food-fish-parser-ruby's Issues

Parse area when method unknown

The text

Alaska pollakfilet, uit de Stille Oceaan

Has a fish name and an area, but it is unknown whether it is wild or aquaculture. It would be nice to still recognize this. This requires a change in the data structure (which the flat parser sometimes already does), to something like:

[
  {
    :names =>   [{ :common=>"Alaska pollakfilet", :latin=>nil }],
    :areas =>   [{ :text=>"de Stille Oceaan", :fao_codes=>[]}],
    :methods => [],
    :kind =>    nil,
  },
]

Add aquaculture

Right now only fishing details are recognized, also add aquaculture.

Parse a/b/c alternatives

Some fish detail texts have an option list with different possibilities, e.g.

  • Alaska KOOLVIS gevangen in: A = het Noordwestelijke deel Stille Oceaan (FAO 61) gevangen met trawlnetten of B = het Noordoostelijke deel Stille Oceaan (FAO 67)
  • gevangen met trawlnetten in fao 27-i barentszzee (a), fao27-iia noorse zee (b), fao27-iib spitsbergen en bereneiland (c)
  • Gevangen in de (A) Barentszzee, (B) Noorse Zee of (C) Spitsbergen en Bereneiland.

Make output format more consistent

When it is unknown whether the fish was caught or raised using aquaculture, the output format is unsuitable. This was encountered with the flat parser, which may return methods and areas (instead of catch_areas, catch_methods, aquaculture_areas and aquaculture_methods).

It would be clearer to use the following output format:

[
  {
    :names =>   [{ :common=>"Alaska pollakfilet", :latin=>nil }],
    :areas =>   [{ :text=>"de Stille Oceaan", :fao_codes=>[]}],
    :methods => [],
    :kind =>    "caught",
  },
]

This would have the following benefits:

  • consistent output format (also when kind is unknown)
  • allow returning kind when no area or method is found (see also #3)

Note that this breaks the API, requiring a major version bump.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.