Skip to content

Date comparison bug #48

@cegme

Description

@cegme

In the check_date function, there are lines of code here, here,here, and here that compare integers with string using a value comparison. The date attribute of the NounPhrase class and its Phrase superclass are strings. These lines don't throw errors in Python2 but they do in Python3.

Also, I'm not sure it works as intended. When going through the test_noun_meaning1 test, we see the following conflict.

>>> '081315' >= int('150578')
True
>>> int('081315') >= int('150578')
False

Here is the output of Python3

>>> '081315' >= int('150578')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '>=' not supported between instances of 'str' and 'int'
>>> int('081315') >= int('150578')
False

What should the expected behavior be here?

It looks like we should be comparing the dstr_to_ordate(curdate) to the integer date. Here the dstr_to_ordate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions