Skip to content

Commit

Permalink
doc-fix: update paths for statistics package, too
Browse files Browse the repository at this point in the history
  • Loading branch information
bjthehun committed Mar 21, 2024
1 parent 8f299e4 commit c84cc26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions wiki/Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ The `after` hook is called after the normalization has created the respective no
In this example we construct a new feature to extract, with the name "*example*".
Whenever this name appears, you may substitute this with whatever name fits your feature best (as long as the name is unique).

1. **Create a new file in `src/statistics/features/supported`**\
1. **Create a new file in `statistics/src/features/supported`**\
Create the file `example.ts`, and add its export to the `index.ts` file in the same directory (if not done automatically).

2. **Create the basic structure**\
Expand Down Expand Up @@ -1090,13 +1090,13 @@ Whenever this name appears, you may substitute this with whatever name fits your

The `initialExampleInfo` type holds the initial values for each counter that you want to maintain during the feature extraction (they will usually be initialized with 0). The resulting `ExampleInfo` type holds the structure of the data that is to be counted. Due to the vast amount of data processed, information like the name and location of a function call is not stored here, but instead written to disk (see below).

Every new feature must be of the [`Feature<Info>`](https://github.com/Code-Inspect/flowr/tree/main/src/statistics/features/feature.ts) type, with `Info` referring to a `FeatureInfo` (like `ExampleInfo` in this example). Next to a `name` and a `description`, each Feature must provide:
Every new feature must be of the [`Feature<Info>`](https://github.com/Code-Inspect/flowr/tree/main/statistics/src/features/feature.ts) type, with `Info` referring to a `FeatureInfo` (like `ExampleInfo` in this example). Next to a `name` and a `description`, each Feature must provide:

- a processor that extracts the information from the input, adding it to the existing information.
- a function returning the initial value of the information (in this case, `initialExampleInfo`).

3. **Add it to the feature-mapping**\
Now, in the `feature.ts` file in `src/statistics/features`, add your feature to the `ALL_FEATURES` object.
Now, in the `feature.ts` file in `statistics/src7features`, add your feature to the `ALL_FEATURES` object.

Now, we want to extract something. For the *example* feature created in the previous steps, we choose to count the amount of `COMMENT` tokens.
So we define a corresponding [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath) query:
Expand Down
2 changes: 1 addition & 1 deletion wiki/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Its subcomponents (like the custom [R bridge](https://github.com/Code-Inspect/fl

The [benchmarker](https://github.com/Code-Inspect/flowr/tree/main/benchmark) module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer. It is available with the [`benchmark`](#benchmark-the-slicer) script.

The [statistics](https://github.com/Code-Inspect/flowr/tree/main/src/statistics) module is mostly independent of the slicer and can be used to analyze R files regarding their use of function definitions, assignments, and more. It is used to identify common patterns in R code and is available with the [`statistics`](#generate-usage-statistics-of-r-code) script.
The [statistics](https://github.com/Code-Inspect/flowr/tree/main/statistics) module is mostly independent of the slicer and can be used to analyze R files regarding their use of function definitions, assignments, and more. It is used to identify common patterns in R code and is available with the [`statistics`](#generate-usage-statistics-of-r-code) script.

The [core](https://github.com/Code-Inspect/flowr/tree/main/src/core) module contains *flowR*'s read-eval-print loop (REPL) and *flowR*'s server. Furthermore, it contains the root definitions of how *flowR* slices (see the [interface](https://github.com/Code-Inspect/flowr/wiki/Interface) wiki page for more information).

Expand Down

0 comments on commit c84cc26

Please sign in to comment.