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

Cannot recognize keyword's array if term contains spaces " " #34

Open
terrynguyen255 opened this issue Aug 28, 2019 · 3 comments
Open

Comments

@terrynguyen255
Copy link

Hi @nepsilon ,

Thank you for your work on this awesome package.
I'd like to report an issue I found:

Code:

const parsedParams = advancedSearchParser.parse(
  `sentFrom:"Harry Potter","Hermione Granger","Ron Weasley" you are a wizard`,
  {
    alwaysArray: true,
    keywords: ['sentFrom'],
    offsets: false
  }
);

Reality:

{
  text: ',"Hermione Granger","Ron Weasley you are a wizard',
  sentFrom: [ 'Harry Potter' ],
  exclude: {}
}

Expectation:

{
  text: 'you are a wizard',
  sentFrom: [ 'Harry Potter', 'Hermione Granger', 'Ron Weasley' ],
  exclude: {}
}

These work-around cases work, but sometime we just cannot walk around:

sentFrom:Harry,Hermione,Ron you are a wizard
sentFrom:"Harry Potter" sentFrom:"Hermione Granger" sentFrom:"Ron Weasley" you are a wizard

Thank you for your time.

@Pranoy1c
Copy link

@Nogias9x I found that if you change your text to

`sentFrom:"Harry Potter,Hermione Granger,Ron Weasley" you are a wizard`

then it works fine. Aka, remove the double quotes between the names.

@terrynguyen255
Copy link
Author

Thank you for checking it @Pranoy1c .

By now, I'm not having time to check it at my end. But I will. So just close this issue.
I will get back to you when I checked it.

Thank you so much and best regards.

@terrynguyen255
Copy link
Author

BTW, I think it'd be great if we have this case update in document.
Just my 2 cents :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants