Repo for the search and displace core module including the interface to select files and search and displace operations to run on them. https://searchanddisplace.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.4 KiB

  1. # Search and Displace Core
  2. ## Install
  3. ### Search and Displace Ingest integration
  4. Add in .env the 'WEBHOOK_CLIENT_SECRET' value.
  5. ### Facebook Duckling
  6. - `$ apt-get install libpcre3-dev`
  7. - `$ cd ..`
  8. - `$ git clone https://github.com/facebook/duckling.git && cd duckling`
  9. - `$ curl -sSL https://get.haskellstack.org/ | sh`
  10. - `$ stack build && stack exec duckling-example-exe`
  11. - `$ stack test`
  12. ### Converting documents from MD to ODT
  13. - `$ apt-get install pandoc`
  14. # Searchers
  15. There are 2 types of searchers: basic and compounded
  16. ## Basic searcher
  17. There are 2 types of basic searchers: native and custom
  18. ### Native basic searcher
  19. This type of searchers are added by default in the app and cannot be edited or deleted.
  20. - Amount of Money
  21. - Credit Card Number
  22. - Distance
  23. - Duration
  24. - Email
  25. - Numeral
  26. - Ordinal
  27. - Phone Numbers
  28. - Quantity
  29. - Temperature
  30. - Time
  31. - Url
  32. - Volume
  33. ### Custom basic searcher
  34. You can add a custom basic searcher by clicking the 'Add regex' button found in the navbar.
  35. This searcher is a regular expression.
  36. Example: `[d\]{4}-[d\]{3}-[d\]{3}` searches, in the document, all text strings that
  37. have 4 digits, a dash, 3 digits, a dash, and finally 3 digits; 1234-123-123 is a valid text.
  38. ## Compounded searcher
  39. A compounded searcher contains one or more searchers, which can be either basic or comopounded.
  40. The searchers can be listed in two ways: in rows and in columns. Each column in a row
  41. extends the searching criteria and each row filters the results of the previous row.
  42. Let's take as an example the following searcher: the first row has 2 searchers, in the first column
  43. we have the 'Email' native basic searcher and in the second column we have a custom basic searcher
  44. which searches for text strings that have a leading '#' character. The second rows has only one column
  45. and that column has a custom basic searcher which searches for text strings which contain the '@' character.
  46. After we execute the Search&Displace the first row of the searcher will be applied on the initial document content
  47. and will find all email addresses and all text strings which have a leading '#' character, so the operation applies
  48. the searchers in the first row independently, each column extending the searching criteria.
  49. Then the second row will be applied on the results of the first row, so on the email addresses and the text strings
  50. which have a leading '#' character, basically each row filters the results of the previous row.
  51. # Demo Version
  52. Is available here https://demo.searchanddisplace.com/
  53. No authentication is required.
  54. # Demo Steps
  55. - Select and upload a document file (supported files: .docx, .pdf, .odt, .txt)
  56. - After the file is uploaded and processed you will see it's contents on the page
  57. - Select searchers by clicking the 'List' button on the right, for each searcher you can input a replace value, so for example if you select the 'Email' searcher and input the replace value as 'EMAIL' then all email addresses which are found in the document will be replaced with the text EMAIL
  58. - After you are done with the searchers selection you can hide the panel by clicking again on the 'List' button
  59. - You can execute the Search&Displace by clicking on the 'Run filters' button
  60. - After the processing is done you will see the resulting document in the right panel, side by side with the initial document
  61. - You can highlight the found and replaced items by toggling the 'Highlight differences' button