scorelab / OpenMF

An Open Source Mobile Forensics Investigation Tool for Android Platform
Apache License 2.0
146 stars 94 forks source link

Keyword search #195

Closed swapnalshahil closed 3 years ago

swapnalshahil commented 3 years ago

Description

Keyword search - Implementation of keyword search to get all the cases that have the searched keyword. Create API which will give all the cases which include the "searched keyword". (this will help in the front-end part) API: http://127.0.0.1:5000/keyword/search method = POST { "keyword": "word" }

Fixes #193

Type of change

How Has This Been Tested?

POSTMAN

2021-06-29 2021-06-29 (1) 2021-06-29 (2)

Checklist:

swapnalshahil commented 3 years ago

@shivanshu1333 sir! Please review. šŸ™‚

swapnalshahil commented 3 years ago

Description

Implement keyword search from cases. Create API which will give the path if searched keyword present in a particular data. (this will help in the front-end part)

API: http://127.0.0.1:5000/keyword//search

method = ["POST"] { "case_name": "Case1", "keyword": "word" }

Fixes: #194

Type of change

How Has This Been Tested?

POSTMAN

2021-07-01

Checklist:

swapnalshahil commented 3 years ago

@shivanshu1333 sir! I read about different algorithms to get optimal methods for keyword search. Here are some: m is the length of the pattern, n the length of the searchable text

  1. Rabin Karp algorithm - > Time complexity : average Ī˜(n + m),worst Ī˜((nāˆ’m)m) and Space O(1)
  2. KMP algorithm -> Time complexity: Ī˜(n) and Space Ī˜(m)
  3. Boyer Moore string search algo. -> Time complexity : best Ī©(n/m),worst O(mn) and Space Ī˜(k)
  4. Two-way string match algo. -> Time complexity : O(n+m) and space O(1)

These are some mostly used algorithms. However, from Python 3.10, the algorithm was updated to use an enhanced version of the Crochemore and Perrin's Two-Way string matching algorithm.

(source) https://github.com/python/cpython/blob/main/Objects/stringlib/stringlib_find_two_way_notes.txt

PS: I think I used the same method which is efficient and in @python.šŸ™‚

swapnalshahil commented 3 years ago

@shivanshu1333 sir I am having python linter by Microsoft in my vs code.

shivanshuraj1333 commented 3 years ago

Can you please try to fix it?

swapnalshahil commented 3 years ago

Now I think it's good!