Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add definitions of terms used in results #3064

Open
mikemaccana opened this issue Jan 5, 2023 · 0 comments
Open

[Docs] Add definitions of terms used in results #3064

mikemaccana opened this issue Jan 5, 2023 · 0 comments

Comments

@mikemaccana
Copy link

mikemaccana commented Jan 5, 2023

Describe the bug

Börje Karlsson mentioned I should file this bug on Hacker News.

I'm an active user of this library - thanks for making it! One piece of feedback is: the documentation https://github.com/Microsoft/Recognizers-Text/tree/master/Ja... doesn't seem to cover the the various terms used in the results.

Specifically

  • What is a culture? The type is string - English seems to work (I found it in an example) but I'm not sure. Maybe en-GB would be better,
  • What are the items in the array returned from recognizeDateTime.
  • What is a resolution?
  • What are start and end?
  • Is the best resolution always first?
  • Is there some way to make resolution always be in the past? Or the future? Eg if I have a list of transactions (in the past) I would want 'October' to only resolve to last October. If I am filling in a delivery date, I want 'October' to always be in the future.

The README for the JS package doesn't seem to cover what these are, so I'm currently just guessing.

My code currently contains this:

    // TODO: what does recognizeDateTime() actually return
    // Feels like these are the 'recognisable entities' that were found but I can't find docs.
    const recognizedDateTimeEntities = recognizeDateTime(
      filterValue,
      // This is just 'string' in the types but it seems to work.
      // TODO: find docs, check if this is valid.
      "English"
    );
    if (recognizedDateTimeEntities.length) {
      const firstEntity = recognizedDateTimeEntities[0];
      // TODO: what is a resolution?
      // Guessing this is each possible value for each recognisable item but I can't find docs.
      // eg if the user enters 'october'
      // values[0] is in the past
      // values[1] is in the future
      // we always want the past, hence picking 0.
      const firstResolution = firstEntity?.resolution?.values[0] || null;
      ...

Expected behavior
Either docs covering the various terms used in recognizedDateTime() output in the README, or a link to somewhere else if this documentation is there instead.

Platform (please complete the following information):

  • Platform: JavaScript
  • Environment: npm
  • Version of package: 1.3.0
@tellarin tellarin changed the title Add definition of terms used in results - 'recognizedDateTime()' array items, 'resolution', 'start', 'end' etc [Docs] Add definitions of terms used in results Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants