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

Improve documentation around "original_text" vs. "text" variables #247

Open
2 tasks
fhightower opened this issue Jul 4, 2022 · 0 comments
Open
2 tasks
Labels
docs enhancement New feature or request priority: 3 (low) time est: 0.1 hour We estimate this issue will take ≈0.1 hour to complete

Comments

@fhightower
Copy link
Owner

We should clarify the purpose of the original_text` variable.

  • make original_text a constant?
  • Add docs/comment noting why we parse from original_text to find some ioc types while others are parsed from text

Here's an explanation of the diff between the two variables I shared in another context:

Why are some IOC types are pulled from "original_text" while others are pulled from "text"? The "original_text" points to a string which remains unmodified throughout the code while the "text" variable points to a string which can be modified (e.g. it may have URLs removed from it). When parsing some values, like CVEs, we choose to parse from "original_text" because we want to parse CVEs from URLs even if URLs were removed from the "text" variable. Basically, any IOC data which has a standard (e.g. CVEs or TLDs) is parsed from original_text b/c we want to parse such IOC data from URLs.

@fhightower fhightower added docs enhancement New feature or request priority: 3 (low) time est: 0.1 hour We estimate this issue will take ≈0.1 hour to complete labels Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement New feature or request priority: 3 (low) time est: 0.1 hour We estimate this issue will take ≈0.1 hour to complete
Projects
None yet
Development

No branches or pull requests

1 participant