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

Ability to combine() tokens #6

Open
IanMayo opened this issue Oct 31, 2019 · 0 comments
Open

Ability to combine() tokens #6

IanMayo opened this issue Oct 31, 2019 · 0 comments
Assignees
Projects

Comments

@IanMayo
Copy link
Member

IanMayo commented Oct 31, 2019

951212 050000.000 MONDEO_44   @C   269.7   2.0      10

In the above line, the date is composed from the first two tokens. In the current implementation we can only report on the them separately, marking the first as date, and the second as time.

We should be able to combine the two tokens. The combined token will have two spans, and when record is called, the two sets of rows will be given the activity

951212 050000.000 NELSON   @C   22 11 10.63 N 21 41 52.37 W 269.7   2.0      0 

In the above line, a single Position element comes from tokens 5-13. They should all be highlighted as a single token.

One solution for this is probably to allow a Token entity to have a spans = [] array of spans, instead of the single one.

We also require this functionality for Line objects, for when one import element comes from multiple lines.

Pseudocode:

        dateToken = tokens[2]
        timeToken = tokens[3]
        timeVal = timeFor(dateToken, timeToken)
        dateTimeToken = combine(dateToken, timeToken)
        dateTimeToken.record(eventImporter, "DateTime", timeVal)

The record() method goes through the file, add adds the new usage to the chars reprsented by both dateToken and timeToken

@IanMayo IanMayo added this to To do in Development Oct 31, 2019
@roman-hrybinchuk roman-hrybinchuk moved this from To do to In progress in Development Nov 6, 2019
@roman-hrybinchuk roman-hrybinchuk mentioned this issue Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development
  
In progress
Development

No branches or pull requests

2 participants