Skip to content
Snippets Groups Projects
Commit 838b7e33 authored by Simon Will's avatar Simon Will
Browse files

Change meter choice algorithm

parent 541e3703
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,8 @@ ALL_METERS = {
),
}
ALL_METER_NAMES = list(ALL_METERS.keys())
def get_reading_meter_combinations(readings, meters=ALL_METERS):
reading_meter_rmfeatures = [
......
......@@ -8,13 +8,15 @@ from typing import List
from .config import RANKING_MODEL_PATH
from .features import combine_features
from .meters import ALL_METERS, get_reading_meter_combinations
from .meters import ALL_METERS, ALL_METER_NAMES, get_reading_meter_combinations
from .model import Verse
from .scanner import Scanner
def scan(plain_verses: List[str], meters=ALL_METERS, **options) -> List[Verse]:
def scan(plain_verses: List[str], meters=ALL_METER_NAMES,
**options) -> List[Verse]:
"""Scan Latin verses."""
meters = [ALL_METERS[m] for m in meters if m in ALL_METERS]
scanner = Scanner()
scanned_verses = scanner.scan_verses(plain_verses)
model = joblib.load(RANKING_MODEL_PATH)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment