Просмотр исходного кода

Fix nested groups calculation and add example to Readme

tags/v0.1.0
Garrick Aden-Buie 8 лет назад
Родитель
Сommit
65faa5f601
4 измененных файлов: 18 добавлений и 2 удалений
  1. +2
    -2
      R/run_regex.R
  2. +8
    -0
      Readme.Rmd
  3. +8
    -0
      Readme.md
  4. Двоичные данные
      docs/view-nested.png

+ 2
- 2
R/run_regex.R Просмотреть файл

for (j in seq_len(nrow(inserts))) { for (j in seq_len(nrow(inserts))) {
if (inserts$i[j] == 0) next if (inserts$i[j] == 0) next
overlap <- filter( overlap <- filter(
inserts,
inserts[1:(j-1), ],
i != 0, i != 0,
start <= !!inserts$start[j] & end > !!inserts$end[j])
start <= !!inserts$start[j] & end >= !!inserts$end[j])
inserts[j, 'pad'] <- inserts$pad[j] + nrow(overlap) inserts[j, 'pad'] <- inserts$pad[j] + nrow(overlap)
} }
inserts <- inserts %>% inserts <- inserts %>%

+ 8
- 0
Readme.Rmd Просмотреть файл



![Example `view_regex(text, pattern)`.](docs/view-regex.png) ![Example `view_regex(text, pattern)`.](docs/view-regex.png)


```r
t_nested <- "anestedgroupwithingroupexample"
r_nested <- "(a(nested)(group(within(group))(example)))"
view_regex(t_nested, r_nested)
```

![Example of nested groups](docs/view-nested.png)



## Planned (ish) ## Planned (ish)



+ 8
- 0
Readme.md Просмотреть файл



![Example `view_regex(text, pattern)`.](docs/view-regex.png) ![Example `view_regex(text, pattern)`.](docs/view-regex.png)


``` r
t_nested <- "anestedgroupwithingroupexample"
r_nested <- "(a(nested)(group(within(group))(example)))"
view_regex(t_nested, r_nested)
```

![Example of nested groups](docs/view-nested.png)

## Planned (ish) ## Planned (ish)


1. An Rstudio addin gadget that allows you to interactively enter the 1. An Rstudio addin gadget that allows you to interactively enter the

Двоичные данные
docs/view-nested.png Просмотреть файл

Before After
Width: 1880  |  Height: 302  |  Size: 23KB

Загрузка…
Отмена
Сохранить