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

Implementing a dummy-model #539

Merged
merged 4 commits into from
Apr 21, 2020
Merged

Implementing a dummy-model #539

merged 4 commits into from
Apr 21, 2020

Conversation

lfoppiano
Copy link
Collaborator

@lfoppiano lfoppiano commented Jan 29, 2020

The advantages:

  • possibility to test parser class side methods
  • remove the needs of having the grobid home around (a particular problem for sub-modules)

Implementation:

  • added a GrobidModels.DUMMY
  • added a DummyTagger which is returned from TaggerFactory only for GrobidModels.DUMMY and tags everything as <dummy>

This was mentioned in issue #410

…s provided + removed duplicated code in TaggerFactory
@coveralls
Copy link

coveralls commented Jan 29, 2020

Coverage Status

Coverage increased (+0.2%) to 38.204% when pulling 5ac80f5 on dummy-model-for-test into 0dfd457 on master.

@lfoppiano
Copy link
Collaborator Author

lfoppiano commented Jan 29, 2020

Used in the following: https://github.com/lfoppiano/grobid-superconductors/blob/master/src/test/java/org/grobid/core/engines/SuperconductorsParserTest.java

Excerpt:

public class SuperconductorsParserTest {

    private SuperconductorsParser target;

    private ChemDataExtractionClient mockChemspotClient;

    @Before
    public void setUp() throws Exception {
        mockChemspotClient = EasyMock.createMock(ChemDataExtractionClient.class);
        target = new SuperconductorsParser(GrobidModels.DUMMY, mockChemspotClient);
    }
[...]

I will write a few unit tests around it

@lfoppiano lfoppiano added this to the 0.6.0 milestone Apr 17, 2020
@kermitt2 kermitt2 merged commit c259743 into master Apr 21, 2020
@lfoppiano lfoppiano deleted the dummy-model-for-test branch May 28, 2020 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants