Skip to content

Commit

Permalink
Merge pull request #124 from ddehilster/VISUALTEXT-FILES-101
Browse files Browse the repository at this point in the history
VISUALTEXT-FILES-101 fix date time parser, still not perfect
  • Loading branch information
ddehilster authored Jul 21, 2024
2 parents 981f43c + f46b7eb commit f003129
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 255 deletions.
2 changes: 1 addition & 1 deletion analyzers/Date and Times/input/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sept 04, 2014.
11. 12. 2014, 08:45:39
12th day of December, 2001
13/03/2014
19 February 2013 year 09:10
19 February 2013 09:10
19th day of May, 2015
2:21 p.m., December 11, 2014
20 Mar 2013
Expand Down
6 changes: 1 addition & 5 deletions analyzers/Date and Times/input/text02.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
2017-02-03T09:04:08,00123Z
2017-02-03T09:04:08.001Z
2017-02-03T09:04:08Z
2003
2017-02-03T09:04:08Z to 2017-02-03T09:04:09Z
Wed Aug 05 12:00:00 EDT 2015
382 changes: 191 additions & 191 deletions analyzers/Date and Times/kb/user/timezones.dict

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions analyzers/Date and Times/spec/analyzer.seq
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
dicttokz nil # Gen: Convert input to token list
nlp LinesDictTokZ # comment
nlp funcs # comment
nlp numbers # comment
nlp ordinals # comment
nlp times # comment
nlp zulu # comment
nlp times1 # comment
nlp timeAdd # comment
nlp dates # comment
nlp datesDay # comment
nlp highlight # comment
2 changes: 1 addition & 1 deletion analyzers/Date and Times/spec/dates.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

###############################################
# 19th day of May, 2015
Expand Down
32 changes: 31 additions & 1 deletion analyzers/Date and Times/spec/datesDay.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,37 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

###############################################
# Wed Aug 05 12:00:00 EDT 2015
###############################################

@PRE
<1,1> var("day");
<2,2> var("month");
<3,3> var("day");
<5,5> var("year");

@POST
S("weekday") = N("$text",1);
S("month") = N("month",2);
S("day") = num(N("$text",3));
S("year") = num(N("$text",5));

S("hour") = N("hour",4);
S("min") = N("min",4);
S("sec") = N("sec",4);
single();

@RULES
_dateTime <-
_xALPHA ### (1)
_xALPHA ### (2)
_xNUM ### (3)
_time ### (4)
_xNUM ### (5)
@@

###############################################
# Fri, 12 Dec 2014
Expand Down
2 changes: 1 addition & 1 deletion analyzers/Date and Times/spec/highlight.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

@POST
noop();
Expand Down
2 changes: 1 addition & 1 deletion analyzers/Date and Times/spec/numbers.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

@POST
L("num") = num(N("$text",1));
Expand Down
2 changes: 1 addition & 1 deletion analyzers/Date and Times/spec/ordinals.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

@POST
S("num") = num(N("$text",1));
Expand Down
2 changes: 1 addition & 1 deletion analyzers/Date and Times/spec/times.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

###############################################
# 10:04:23 pm
Expand Down
43 changes: 0 additions & 43 deletions analyzers/Date and Times/spec/times1.nlp

This file was deleted.

14 changes: 13 additions & 1 deletion analyzers/Date and Times/spec/zulu.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@
# MODIFIED:
###############################################

@NODES _LINE
@NODES _ROOT

@POST
S("time") = N("$text",1);
S("adjust") = N("$text",3);
single();

@RULES
_time <-
_time ### (1)
\+ ### (2)
_time ### (3)
@@

@POST
L("num") = num(N("$text",1));
Expand Down
12 changes: 6 additions & 6 deletions analyzers/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Template Analyzers
# Block Analyzers

These are the templates for creating new analyzers using the [NLP++ VSCode language extension](http://vscode.visualtext.org).
These are blocks for creating new analyzers using the [NLP++ VSCode language extension](http://vscode.visualtext.org).

## Rules for Template Analyzers
## Rules for Block Analyzers

These are the rules for submitting template analyzers:
These are the rules for submitting block analyzers:

1. The folder name should be a two to three word descriptive name for the analyzer
2. The first line in the readme should be the same title with a "#" sign header
3. The next line that contains text should be a short description of the analyzer that will appear in the NLP++ VSCode Extension
4. The rest of the README file should contain information about the analyzer that will assist the end user on how to use and augment the analyzer.

Here is an example start of a template analyzer README file:
Here is an example start of a block analyzer README file:

```
# Moose Analyzer
Allows for analyzing text for articles on moose (appears in the description of the selection template analyzer selection list)
Allows for analyzing text for articles on moose (appears in the description of the selection block analyzer selection list)
## Using the Moose Analyzer
Expand Down

0 comments on commit f003129

Please sign in to comment.