Skip to content

Commit

Permalink
Reformatting and adding tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadusko committed May 12, 2024
1 parent eb2fe96 commit 670a7d6
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore Python cache files
__pycache__/

# Ignore system and editor files
.DS_Store
*.swp
*.swo
*.bak
*~
5 changes: 0 additions & 5 deletions finger/__init__.py

This file was deleted.

5 changes: 5 additions & 0 deletions fingerGeoparser/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# __init__.py

#from finger.toponym_coder import *
#from finger.toponym_tagger import *
#from finger.output_formatter import *
6 changes: 3 additions & 3 deletions finger/geoparser.py → fingerGeoparser/geoparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"""


from finger.toponym_tagger import toponym_tagger
from finger.toponym_coder import toponym_coder
from finger.output_formatter import create_eupeg_json
from fingerGeoparser.toponym_tagger import toponym_tagger
from fingerGeoparser.toponym_coder import toponym_coder
from fingerGeoparser.output_formatter import create_eupeg_json


import time, asyncio, pandas as pd
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions tests/test_geoparsing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys
print(sys.path)

from fingerGeoparser import geoparser

def test_constructor():
gp = geoparser.geoparser(pipeline_path="fi_core_news_sm")
assert isinstance(gp, geoparser.geoparser)

def test_method():
gp = geoparser.geoparser(pipeline_path="fi_core_news_sm")
res = gp.geoparse(["Helsinki on kaunis tänään", "Paris Hilton mokasi."])

#assert isinstance(gp, geoparser)

0 comments on commit 670a7d6

Please sign in to comment.