Skip to content

Commit

Permalink
slight formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adilkassim committed Feb 19, 2024
1 parent e8d246d commit 4e35327
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions utils/linkage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
import usaddress
from names_dataset import NameDataset


"""
Module for performing record linkage on state campaign finance dataset
"""
import os.path
import re

import pandas as pd
import textdistance as td
import usaddress

from utils.constants import COMPANY_TYPES, repo_root

Expand Down Expand Up @@ -278,7 +275,6 @@ def get_street_from_address_line_1(address_line_1: str) -> str:
return " ".join(string)



def name_rank(first_name: str, last_name: str) -> list:
"""Returns a score for the rank of a given first name and last name
https://github.com/philipperemy/name-dataset
Expand All @@ -300,10 +296,10 @@ def name_rank(first_name: str, last_name: str) -> list:
>>> name_rank(None, 9)
[None, None]
"""

# Initialize the NameDataset class
nd = NameDataset()

first_name_rank = 0
last_name_rank = 0
if isinstance(first_name, str):
Expand All @@ -325,7 +321,8 @@ def name_rank(first_name: str, last_name: str) -> list:
else:
last_name_rank = None
return [first_name_rank, last_name_rank]
=======


def convert_duplicates_to_dict(df: pd.DataFrame) -> None:
"""Saves to the "output" directory a file where each row represents a string
matching to another string
Expand Down

0 comments on commit 4e35327

Please sign in to comment.