From c84cc26676c1426582118b95bfc087f72c0e73b0 Mon Sep 17 00:00:00 2001 From: Benedikt Jutz Date: Thu, 21 Mar 2024 16:50:37 +0100 Subject: [PATCH] doc-fix: update paths for statistics package, too --- wiki/Interface.md | 6 +++--- wiki/Overview.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wiki/Interface.md b/wiki/Interface.md index 2ced1fb247..18af66f0d3 100644 --- a/wiki/Interface.md +++ b/wiki/Interface.md @@ -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**\ @@ -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`](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`](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: diff --git a/wiki/Overview.md b/wiki/Overview.md index 4adb1e2e11..dd7df36668 100644 --- a/wiki/Overview.md +++ b/wiki/Overview.md @@ -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).