spiegel-keyman/developer/docs/help/reference/api/kmc-analyze.analyzeoskcharacteruse.md
Marc Durdin b751336c13 refactor(developer): copy dev 17.0 help into repo
1. Copy help.keyman.com/developer/17.0/* into /developer/docs/help
2. Update references to 18.0 where appropriate
3. Copy all referenced images from /cdn/dev into
   /developer/docs/help/images and update links in documentation

Next commit: add deployment to help-keyman-com.sh. Note: simplest way to
test links at this point is to use the help.keyman.com auto deploy and
wait for the PR on help.keyman.com to be validated; we could look at an
internal link validation tool that verifies markdown links?

Relates-to: #12347
2024-09-16 08:46:24 +07:00

28 lines
2.6 KiB
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [@keymanapp/kmc-analyze](./kmc-analyze.md) &gt; [AnalyzeOskCharacterUse](./kmc-analyze.analyzeoskcharacteruse.md)
## AnalyzeOskCharacterUse class
Analyze the characters used in On Screen Keyboard files (.kvks, .keyman-touch-layout) for use with `&displayMap`<!-- -->.
**Signature:**
```typescript
export declare class AnalyzeOskCharacterUse
```
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(callbacks, options)](./kmc-analyze.analyzeoskcharacteruse._constructor_.md) | | Constructs a new instance of the <code>AnalyzeOskCharacterUse</code> class |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [analyze(file)](./kmc-analyze.analyzeoskcharacteruse.analyze.md) | | <p>Analyzes a single source file for Unicode character usage. Can parse .kmn, .kvks, .keyman-touch-layout file formats. Can be called multiple times to collect results from more than one file. Use [AnalyzeOskCharacterUse.getStrings()](./kmc-analyze.analyzeoskcharacteruse.getstrings.md) to retrieve results.</p><p>Note: <code>analyze()</code> collects key cap data, so calling this for a .kmn file will retrieve the key caps from the .kvks and .keyman-touch-layout files that it references, rather than key cap data from the .kmn file itself.</p> |
| [clear()](./kmc-analyze.analyzeoskcharacteruse.clear.md) | | Clears analysis data collected from previous calls to [AnalyzeOskCharacterUse.analyze()](./kmc-analyze.analyzeoskcharacteruse.analyze.md) |
| [getStrings(format)](./kmc-analyze.analyzeoskcharacteruse.getstrings.md) | | <p>Returns the collected results from earlier calls to [AnalyzeOskCharacterUse.analyze()](./kmc-analyze.analyzeoskcharacteruse.analyze.md)<!-- -->. This generates a mapping from a key cap (one or more characters) to a PUA code, for use with <code>&amp;displayMap</code>.</p><p>Three output formats are supported:</p><p>- .txt: tab-separated string format, with three columns: PUA, Key Cap, and plain string. The PUA and Key Cap columns are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string is the original key cap string.</p><p>- .md: formatted for documentation purposes. Generates a Markdown table (GFM) with PUA, Key Cap, and plain string. The PUA and Key Cap columns are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string is the original key cap string.</p><p>- .json: returns the final aggregated data as an array of strings, which can be joined to form a JSON blob of an object with a single member, <code>map</code>, which is an array of objects.</p> |