Skip to content

Commit

Permalink
some minor fixes; cleanup;
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjan-stha committed Feb 2, 2024
1 parent 32fb381 commit f7722d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions analysis_module/mockserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,12 @@ def shape_geo_entities(entity: dict, excerpt: str):
ent = {}
ent["entity"] = entity["ent"]
start = random.randint(0, len(excerpt) - len(entity["ent"]))
ent["meta"] = {}
ent["meta"].update({"offset_start": start, "offset_end": start + len(entity["ent"])})
ent["meta"] = {
"offset_start": start,
"offset_end": start + len(entity["ent"]),
"latitude": None,
"longitude": None
}
ent["meta"].update({"latitude": None, "longitude": None})
for geoid in entity["geoids"]:
if entity["ent"] == geoid["match"]:
Expand Down Expand Up @@ -267,7 +271,7 @@ def shape_geo_entities(entity: dict, excerpt: str):


def geolocation_mock_model(body) -> Any:
process_geolocation.delay(body) # Trigger task after 2 seconds
process_geolocation.delay(body)
return json.dumps({"status": "Successfully received the request."}), 200


Expand Down

0 comments on commit f7722d7

Please sign in to comment.