import numpy as np

STANDARD_BUILT_FORMS = {
    "unknown",
    # Houses
    "end-terrace", "semi-detached", "detached", "mid-terrace", "enclosed mid-terrace", "enclosed end-terrace",
    # Flats
    "ground floor", "mid-floor", "top-floor", "basement", "low rise", "high rise",
}

BUILT_FORM_MAPPINGS = {
    'House (End Terrace)': 'end-terrace',
    'Ground Floor Flat General': 'ground floor',
    'House (Semi)': 'semi-detached',
    'House (Mid Terrace)': 'mid-terrace',
    'Bungalow': 'unknown',
    'House (Mid terrace)': 'mid-terrace',
    'Maisonette': 'unknown',
    'Flat': 'unknown',
    'First Floor Flat General': 'mid-floor',
    'Bungalow (Semi)': 'semi-detached',

    'Detached House': 'detached',
    'End Terraced House': 'end-terrace',
    'Studio (Ground floor)': 'ground floor',
    'Mid Terraced House': 'mid-terrace',
    'Ground Floor Flat': 'ground floor',
    'Semi Detached House': 'semi-detached',
    'Detached Property': 'detached',
    'Level not confirmed': 'unknown',
    'Bedsit': 'unknown',
    'Cottage': 'detached',
    'Terraced House': 'mid-terrace',
    'Studio (1st Floor)': 'ground floor',
    'Standard Maisonette': 'unknown',
    'Third Floor Flat or Above': 'top-floor',
    'Town House': 'end-terrace',
    'Guest room in a complex': 'unknown',
    'Back To Back House': 'mid-terrace',
    'PIMSS EMPTY': 'unknown',
    'Flat Basement': 'basement',
    'House': 'unknown',
    'Second Floor Flat': 'mid-floor',
    'First Floor Flat': 'ground floor',
    'Room Only': 'unknown',

    'End Terrace Housex': 'end-terrace',
    'Mid Terrace Bungalow': 'mid-terrace',
    'End Terrace Bungalow': 'end-terrace',
    'Mid Terrace House': 'mid-terrace',
    'Detached Bungalow': 'detached',
    'End Terrace House': 'end-terrace',
    'Mid Terrace Housekeeping ': 'mid-terrace',
    'Semi Detached Bung': 'semi-detached',
    'Guest Room': 'unknown',
    'Coach House': 'detached',
    'Office Buildings': 'unknown',
    'Maisonnette': 'mid-floor',
    'Bedspace': 'unknown',
    'Studio (3rd floor and above)': 'top-floor',
    'Adapted Property For Disabled': 'unknown',
    'Studio (2nd floor)': 'mid-floor',
    np.nan: 'unknown',
    'Third Floor Flat': 'mid-floor',
    '2 Ext. Wall Flat': 'mid-terrace',
    'Hostel': 'unknown',
    'Flat: Mid Terrace: Mid Floor': 'mid-terrace',
    'Bungalow: SemiDetached': 'semi-detached',
    'Flat: End Terrace: Top Floor': 'end-terrace',
    'Flat: Enclosed End Terrace: Top Floor': 'end-terrace',
    'Maisonette: End Terrace: Ground Floor': 'end-terrace',
    'Flat: End Terrace: Ground Floor': 'end-terrace',
    'Flat: Mid Terrace: Top Floor': 'mid-terrace',
    'House: Detached': 'detached',
    'Flat: End Terrace: Mid Floor': 'end-terrace',
    'House: SemiDetached': 'semi-detached',
    'Flat: Semi Detached: Ground Floor': 'semi-detached',
    'Flat: Semi Detached: Top Floor': 'semi-detached',
    'Flat: Mid Terrace: Ground Floor': 'mid-terrace',
    'House: MidTerrace': 'mid-terrace',
    'House: EndTerrace': 'end-terrace',
    'Bungalow: EndTerrace': 'end-terrace',
    'Bungalow: MidTerrace': 'mid-terrace',
    'Flat: Semi Detached: Mid Floor': 'semi-detached',
    'Maisonette: Mid Terrace: Top Floor': 'mid-terrace',
    'Flat: Enclosed Mid Terrace: Mid Floor': 'mid-terrace',
    'Flat: Enclosed Mid Terrace: Ground Floor': 'mid-terrace',
    'Flat: Detached: Ground Floor': 'detached',
    'Flat: Detached: Mid Floor': 'detached',
    'Flat: Detached: Top Floor': 'detached',
    'Flat: Enclosed End Terrace: Mid Floor': 'end-terrace',
    'Bungalow: Detached': 'detached',
    'Maisonette: End Terrace: Mid Floor': 'end-terrace',
    'Maisonette: Detached: Top Floor': 'detached',
    'Flat: Enclosed End Terrace: Ground Floor': 'end-terrace',
    'Flat: Enclosed Mid Terrace: Top Floor': 'mid-terrace',
    'House: EnclosedEndTerrace': 'end-terrace',
    '3 Ext. Wall Flat': 'semi-detached',
    'Bungalow Detached': 'detached',
    'Bungalow End Terrace': 'end-terrace',
    'Bungalow Mid Terrace': 'mid-terrace',
    'Bungalow Semi Detached': 'detached',
    'Maisonette 2 Ext. Wall': 'mid-terrace',
    'Maisonette 3 Ext. Wall': 'semi-detached',
    'End-terrace': 'end-terrace',
    'Mid-terrace': 'mid-terrace',
    'Semi-detached': 'semi-detached',
    'Detached': 'detached',
    'Flat / maisonette': 'unknown',
    '2014 onwards': 'unknown',

    'Semi Detached': 'semi-detached',
    'End Terraced': 'end-terrace',
    'Basement': 'basement',
    'No': 'unknown',
    'Mid Terrace': 'mid-terrace',
    'Link Detached': 'detached',
    'Mid Terraced': 'mid-terrace',
    'Ground Floor': 'ground floor',
    'End Terrace': 'end-terrace',
    'Sheltrd Semi Det': 'semi-detached',
    'Shop': 'unknown',
    'Fourth Floor': 'mid-floor',
    'Terraced': 'mid-terrace',
    'Leasehold Terr': 'mid-terrace',
    'Room': 'unknown',
    'Second Floor': 'mid-floor',
    'Third Floor': 'mid-floor',
    'Office': 'unknown',
    'First Floor Over Arch': 'ground floor',
    '16-25 IND-PPL': 'unknown',
    'Seventh Floor': 'top-floor',
    'Sheltered': 'unknown',
    'Shelt Bung End': 'end-terrace',
    'Room In Shared Accommodation': 'unknown',
    'Sheltred Bung Terrace': 'mid-terrace',
    'Garage In Block': 'unknown',
    'First Floor': 'ground floor',
    'First Floor Over Garage': 'ground floor',
    'Leasehold': 'unknown',
    'Sheltred Bung': 'unknown',
    'Garage': 'unknown',
    'Sixth Floor': 'top-floor',
    'Sheltered Bung': 'semi-detached',
    'Guest': 'unknown',
    'Fifth Floor': 'mid-floor',
    'Flat Within Block': 'mid-floor',
    'Coach House with Garage': 'detached',
    'Over Garage House': 'top-floor',
    'Apartment': 'mid-floor',
    'Flat Over Shop': 'top-floor',
    'Flat Over Garage': 'top-floor',
    'Bridge Flat': 'mid-floor',
    'House Mid Terrace': 'mid-terrace',
    'Semi-detached house': 'semi-detached',
    'House Semi Detached': 'semi-detached',
    'House Detached': 'detached',
    'Detached house': 'detached',
    'House End Terrace': 'end-terrace',
    'Flat Ground Floor Mr': 'ground floor',
    'Mais Flat 1St Fl Mr': 'mid-floor',
    'Top-floor maisonette': 'top-floor',
    'Flat 1St Warden Lr': 'mid-floor',
    'Cranwell': 'unknown',
    'No Fines': 'unknown',
    'Flat 1St Elderly Mr': 'mid-floor',
    'Stent Mod': 'unknown',
    'Mais Flat Grd Fl Mr': 'ground floor',
    'Flat 1St Floor Mr': 'mid-floor',
    'Mid-terrace house': 'mid-terrace',
    'Stent Unmod': 'unknown',
    'Flat 2Nd Floor Mr': 'mid-floor',
    'Studio Grd Warden Lr': 'ground floor',
    'Flat Grd Elderly Mr': 'ground floor',
    'Studio Fl Grd Eld Lr': 'ground floor',
    'Scottwood': 'unknown',
    'Airey': 'unknown',
    'Studio Flat 1Stfl Lr': 'mid-floor',
    'Studio Flat 1Stfl Mr': 'mid-floor',
    'Flat Grd Elderly Lr': 'ground floor',
    'Trusteel MKII': 'unknown',
    'No-Fines Concrete': 'unknown',
    'Crosswall': 'unknown',
    'Fidler': 'unknown',
    'Ground-floor maisonette': 'ground floor',
    'Studio Flat Grdfl Mr': 'ground floor',
    'Studio Flat Grd Lr': 'ground floor',
    'Studio Fl Grd Eld Mr': 'ground floor',
    'Bungalow Eld Person': 'unknown',
    'Cornish': 'unknown',
    'B.I.S.F.': 'unknown',
    'Flat 1St Floor Lr': 'mid-floor',
    'Mid-floor flat': 'mid-floor',
    'Bsit Bung Warden Sch': 'unknown',
    'Hawksley': 'unknown',
    'Orlit': 'unknown',
    'Mid-floor maisonette': 'mid-floor',
    'Ground-floor flat': 'ground floor',
    'Flat Grd Floor Lr': 'ground floor',
    'Studio 1St Warden Lr': 'mid-floor',
    'Flat Grd Warden Lr': 'ground floor',
    'end-terrace house': 'end-terrace',
    'Top-floor flat': 'top-floor',
    'End-terrace house': 'end-terrace',
    'Mais Flat 2Nd Fl Mr': 'mid-floor',
    'Flat 1St Elderly Lr': 'mid-floor',
    'Bfly Bung Bed Sitter': 'unknown',
    'Swedish': 'unknown',
    'Bungalow Semi Detach': 'semi-detached',
    '4 Ext. Wall Flat': 'unknown',
    '6 Ext. Wall Flat': 'unknown',
    '5 Ext. Wall Flat': 'unknown',
    'Unknown': 'unknown',
    'Enclosed mid-terrace': 'mid-terrace',
    'Enclosed end-terrace': 'end-terrace',

    'House GROUND FLOOR': 'ground floor',
    'Flat? GROUND FLOOR': 'ground floor',
    'House SD SEMI DETACHED': 'semi-detached',
    'House SEMI DETACHED': 'semi-detached',
    'Flat GROUND FLOOR': 'ground floor',
    '': 'unknown',
    'Flat SEVENTH FLOOR': 'mid-floor',
    'House D': 'detached',
    'House ET': 'end-terrace',
    'House SD Homeless Unit': 'semi-detached',
    'House MT Homeless Unit': 'mid-terrace',
    'Bungalow ET': 'end-terrace',
    'Bungalow D': 'detached',
    'House SD': 'semi-detached',
    'Bungalow Sheltered Accomodation': 'unknown',
    'House. SD': 'semi-detached',
    'Flat FIRST FLOOR MAISONETTE': 'ground floor',
    'Bungalow SD': 'semi-detached',
    'Flat FIRST FLOOR': 'ground floor',
    'Flat Sheltered Accomodation': 'unknown',
    'Flat SIXTH FLOOR': 'mid-floor',
    'Flat EIGHTH FLOOR': 'mid-floor',
    'Flat FOURTH FLOOR': 'mid-floor',
    'Flat Homeless Unit': 'unknown',
    'Bungalow MT': 'mid-terrace',
    'Bungalow Homeless Unit': 'unknown',
    'House MT': 'mid-terrace',
    'Flat FIFTH FLOOR': 'mid-floor',
    'Flat NINTH FLOOR': 'mid-floor',
    'House SD FIRST FLOOR': 'semi-detached',
    'Bungalow Supported housing': 'unknown',
    'Flat THIRD FLOOR': 'mid-floor',
    'Flat SECOND FLOOR': 'mid-floor',
    'House Homeless Unit': 'unknown',
    'Flat ELEVENTH FLOOR': 'mid-floor',
    'Flat TENTH FLOOR': 'mid-floor',
    'House. MT': 'mid-terrace',
    'Ground Floor Bedsit': 'ground floor',
    'Mid Terrace With Passage': 'mid-terrace',
    'End Of Terrace': 'end-terrace',
    'Ground Floor Maisonette': 'ground floor',
    'First Floor Bedsit': 'mid-floor',
    'GROUND FLOOR BEDSIT': 'ground floor',
    'GROUND FLOOR FLAT': 'ground floor',
    'BUNGALOW': 'unknown',
    'HOUSE 1 LIVING ROOM': 'unknown',
    'MAISONETTE OVER SHOP': 'unknown',
    'SECOND FLOOR FLAT': 'mid-floor',
    'FIRST FLOOR FLAT': 'ground floor',
    'GROUND FL MAISONETTE': 'ground floor',
    'HOUSE 2 LIVING ROOMS': 'unknown',
    'FLAT OVER SHOP': 'unknown',

    '4 Bed Detached House': 'detached',
    '2 Bed Detached House': 'detached',
    '3 Bed Detached Bungalow': 'detached',
    '1 Bed Semi-Detached House': 'semi-detached',
    '2 Bed Semi-Detached House': 'semi-detached',
    '2 Bed Detached Bungalow': 'detached',
    '1 Bed Mid Terrace Bungalow': 'mid-terrace',
    '4 Bed Semi-Detached Bungalow': 'semi-detached',
    '3 Bed Mid Terrace Bungalow': 'mid-terrace',
    '3 Bed Semi-Detached Bungalow': 'semi-detached',
    '3 Bed Mid Terrace House': 'mid-terrace',
    '2 Bed Mid Terrace House': 'mid-terrace',
    '3 Bed Detached House': 'detached',
    '2 Bed Semi-Detached Bungalow': 'semi-detached',
    '5 Bed Mid Terrace House': 'mid-terrace',
    '2 Bed Mid Terrace Bungalow': 'mid-terrace',
    '3 Bed Semi-Detached House': 'semi-detached',
    '1 Bed Semi-Detached Bungalow': 'semi-detached',
    '4 Bed Mid Terrace House': 'mid-terrace',
    '1 Bed Detached Bungalow': 'detached',
    '5 Bed Semi-Detached House': 'semi-detached',
    '6 Bed Detached House': 'detached',
    '1 Bed Mid Terrace House': 'mid-terrace',
    '4 Bed Semi-Detached House': 'semi-detached',
    'TBA': 'unknown',
    '1 Bed EOT House': 'end-terrace',
    '3 Bed Flat': 'unknown',
    '5 Bed EOT House': 'end-terrace',
    '1 Bed EOT Bungalow': 'end-terrace',
    '2 Bed EOT House': 'end-terrace',
    '1 Bed Studio Flat': 'unknown',
    '3 Bed Maison': 'unknown',
    'Commercial Letting': 'unknown',
    '4 Bed Maison': 'unknown',
    '2 Bed Flat': 'unknown',
    '3 Bed EOT House': 'end-terrace',
    '2 Bed Maison': 'unknown',
    '4 Bed EOT House': 'end-terrace',
    '1 Bed Flat': 'unknown',
    '3 Bed EOT Bungalow': 'end-terrace',
    '1 Bed Maison': 'unknown',
    '2 Bed EOT Bungalow': 'end-terrace',

    'Bungalow detached': 'detached',
    'Bungalow semi detached': 'semi-detached',
    'Sheltered bungalow semi detached': 'semi-detached',
    'Bedsit bungalow semi detached': 'semi-detached',
    'Semi detached house': 'semi-detached',
    'Bedsit bungalow terraced': 'mid-terrace', 'Terraced house': 'mid-terrace',
    'Sheltered flat': 'unknown',
    'APD Bungalow': 'unknown',
    'Flat with partition': 'unknown',
    'APD flat': 'unknown',
    'Sheltered warden flat': 'unknown',
    'Sheltered bedsit': 'unknown',
    'Sheltered bungalow terraced': 'mid-terrace',
    'Block': 'unknown',
    'Bungalow terraced': 'mid-terrace',
    'Maisonette flat': 'unknown',
    'Sheltered bedsit disabled': 'unknown',
    'Bedsit Flat': 'unknown',
    'Low Rise': 'low rise',
    'Upper Floor': 'top-floor',
    'High Rise': 'high rise',

    '2012 ONWARDS DETACHED': 'detached',
    '1950-66 END TERRACE': 'end-terrace',
    '1976-82 MID TERRACED': 'mid-terrace',
    '1950-66 MID TERRACE': 'mid-terrace',
    '1991-95  DETACHED': 'detached',
    '1976-82 END TERRACED': 'end-terrace',
    '1967-75 DETACHED': 'detached',
    'PRE 1900 DETACHED': 'detached',
    'PRE 1900 MID TERRACE': 'mid-terrace',
    '1900 DET': 'detached',
    '1967-75 MID TERR': 'mid-terrace',
    '1930-49 SEMI DET': 'semi-detached',
    '1900-29 SEMI DET': 'semi-detached',
    '1900-29 MID TERR': 'mid-terrace',
    '1983- 90 MID TERR': 'mid-terrace',
    '1976-82 MID TERR': 'mid-terrace',
    '1983-90 END TERR': 'end-terrace',
    '1991-95 SEMI DET': 'semi-detached',
    '1983-90 SEMI DET': 'semi-detached',
    '1991-95  MID TERR': 'mid-terrace',
    '1950-66 SEMI DET': 'semi-detached',
    '1900 MID TERR': 'mid-terrace',
    '1967-75 SEMI DET': 'semi-detached',
    '1983- 90 SEMI DET': 'semi-detached',
    '1983-90 MID TERR': 'mid-terrace',
    '1976-82 SEMI DET': 'semi-detached',
    'PRE 1900 MID TERR': 'mid-terrace',
    None: 'unknown',

    'SEMI-DETACHED': 'semi-detached',
    'DETACHED': 'detached',
    'MID TERRACE': 'mid-terrace',
    'END TERRACE': 'end-terrace',
    'ENCLOSED MID': 'enclosed mid-terrace',

    'BUILDING': 'unknown',
    'FLAT COMMUNAL FACILITIES': 'unknown',
    'MAISONETTE': 'unknown',
    'HOUSE': 'unknown',
    'FLAT': 'unknown',
    'BLOCK': 'unknown',

    'Semi Detached Bungalow': 'semi-detached',
    'End Terraced Bungalow': 'end-terrace',
    'Mid Terraced Town House': 'mid-terrace',
    'Semi-Detached House': 'detached',
    'Low Rise Flat': 'low rise',
    'Mid Terraced Bungalow': 'mid-terrace',
    'End Terraced Town House': 'end-terrace',
    'Cottage Flat': 'ground floor',
    'Maisonette Over Shop': 'mid-floor',
    'Medium Rise Flat': 'mid-floor',
    'Maisonette Medium Rise': 'unknown',
    'End-terraced house': 'end-terrace',

    'Ground floor study bedroom': 'ground floor',
    'End terrace bungalow': 'end-terrace',
    'End terrace house': 'end-terrace',
    'Ground floor bedsit': 'ground floor',
    'Detached bungalow': 'detached',
    'Lower ground floor flat': 'ground floor',
    'Mid terrace bungalow': 'mid-terrace',
    'Mid terrace house': 'mid-terrace',
    'Basement bedsit': 'basement',
    'Ground floor flat': 'ground floor',
    'Ground floor flat with study': 'ground floor',
    'Basement flat': 'basement',
    'Semi bungalow': 'semi-detached',
    '2nd floor flat': 'mid-floor',
    'General/Communal': 'unknown',
    'Semi house': 'semi-detached',
    '2nd floor flat with study': 'mid-floor',
    '1st floor flat with study room': 'mid-floor',
    'Cluster House': 'detached',
    'Utility pod': 'unknown',
    '3rd floor flat': 'mid-floor',
    '4th floor flat': 'mid-floor',
    '2nd floor study bedroom': 'mid-floor',
    '1st floor study bedroom': 'mid-floor',
    'Dormer bungalow': 'detached',
    '1st floor flat': 'mid-floor',
    'Block property': 'unknown',
    'Utility pod - DDA compliant': 'unknown',
    '2nd floor bedsit': 'mid-floor',
    '1st floor bedsit': 'mid-floor',
    '2nd/3rd floor duplex flat': 'mid-floor',

    'Bungalow - Detached': 'detached',
    'Maisonette - Detached': 'detached',
    'Bedsit - Mid Terrace': 'mid-terrace',
    'House - End Terrace': 'end-terrace',
    'House - Mid Terrace': 'mid-terrace',
    'Bungalow - End Terrace': 'end-terrace',
    'Maisonette - End Terrace': 'end-terrace',
    'Maisonette - Semi Detached': 'semi-detached',
    'House - Detached': 'detached',
    'Bedsit - End Terrace': 'end-terrace',
    'House - Semi detached': 'semi-detached',
    'Studio Flat - Mid Terrace': 'mid-terrace',
    'Bungalow - Semi detached': 'semi-detached',
    'Amenity Block - Detached': 'detached',
    'Bungalow - Mid Terrace': 'mid-terrace',
    'Amenity Block - Semi detached': 'semi-detached',
    'Maisonette - Mid Terrace': 'mid-terrace',
    'Chalet - Wheelchair': 'unknown',
    'Studio Flat': 'unknown',
    'Bungalow - Attached': 'semi-detached',
    'ND': 'unknown',

    'Maisonette: Mid Terrace: Mid Floor': 'mid-floor',
    'Maisonette: Semi Detached: Ground Floor': 'semi-detached',
    'Maisonette: Enclosed Mid Terrace: Ground Floor': 'enclosed mid-terrace',
    'Maisonette: Enclosed End Terrace: Ground Floor': 'end-terrace',
    'Maisonette: Mid Terrace: Ground Floor': 'mid-terrace',
    'Flat: Semi Detached: Basement': 'semi-detached',
    'Maisonette: Semi Detached: Top Floor': 'semi-detached',
    'Maisonette: Enclosed Mid Terrace: Mid Floor': 'enclosed mid-terrace',
    'Flat: Detached: Basement': 'detached',
    'Maisonette: Enclosed Mid Terrace: Top Floor': 'enclosed mid-terrace',

    'Maisonette: End Terrace: Top Floor': 'top-floor',
    'House: Mid Terrace: Ground Floor': 'ground floor',
    'Maisonette: Semi Detached: Mid Floor': 'detached',
    'Maisonette: Detached: Mid Floor': 'detached',
    'Bungalow: EnclosedMidTerrace': 'enclosed mid-terrace',

    'House: EnclosedMidTerrace': 'enclosed mid-terrace',

    'EnclosedMidTerrace': 'enclosed mid-terrace',
    'EnclosedEndTerrace': 'enclosed end-terrace',
    'EndTerrace': 'end-terrace',
    'SemiDetached': 'semi-detached',
    'MidTerrace': 'mid-terrace',

    '1st FLOOR FLAT': 'mid-floor',
    'END TERRACE HOUSE': 'end-terrace',
    'BUNGALOW-END TERRACE': 'end-terrace',
    'BUNGALOW END TERRACE': 'end-terrace',
    'END-TERRACE': 'end-terrace',
    'SEMI DETACHED': 'semi-detached',
    'Mid flat Ground Floor': 'ground floor',
    'MID TERRACED': 'mid-terrace',
    'Mid Terrace bungalow': 'mid-terrace',
    'BUNGLAOW SEMI DETACHED': 'detached',
    'Bungalow ENd Terrace': 'end-terrace',
    'Bungalow Semi detached': 'detached',
    'BUNGALOW - SEMI DETACHED': 'detached',
    'Bungalow mid terrace': 'mid-terrace',
    'BUNGALOW - MID TERRACED': 'mid-terrace',
    'BUNGALOW - MID TERRACE': 'mid-terrace',
    'Bungalow end terrace': 'end-terrace',
    'BUNGALOW SEMI-DETACHED': 'detached',
    'MID TERR': 'mid-terrace',
    'Bungalow - mid terrace': 'mid-terrace',
    'MID-TERRACE': 'mid-terrace',
    'Bunagalow Semi Detached': 'semi-detached',
    'SEMI DETACHED BUNGALOW': 'semi-detached',
    'MID TERRACE HOUSE': 'mid-terrace',
    'END - TERRACE': 'end-terrace',
    'BUNGALOW-SEMI DETACHED': 'semi-detached',
    'Semi-Detached': 'semi-detached',
    'End-Terrace house': 'end-terrace',
    'BUNGALOW MID TERRACE': 'mid-terrace',
    'SEMI DETACHED HOUSE': 'semi-detached',
    'BUNGALOW SEMI DETACHED': 'detached',
    'MID - TERRACE': 'mid-terrace',
    '3 EXT WALL FLAT': 'end-terrace',
    '3 Ext wall flat': 'end-terrace',
    '3 EX WALL FLAT': 'end-terrace',
    '2 ext wall flats': 'mid-terrace',
    '2 EXT WALLS': 'mid-terrace',
    '3.EXT.WALL FLAT': 'end-terrace',
    'FLAT 3 WALLS': 'end-terrace',
    '2 Ext Wall flat': 'mid-terrace',
    'DETATCHED HOUSE': 'detached',
    '3 EXT. WALL FLAT': 'end-terrace',
    '3 ext wall flat': 'end-terrace',
    '3 EXT WALLS': 'end-terrace',
    '3 EXT WALL - NOW 2 EXT': 'unknown',
    '3 EXT-WALL FLAT': 'end-terrace',
    'FLAT 2 WALLS': 'mid-terrace',
    '3 EX WALL MAISONETTE': 'end-terrace',
    '3 Ext Wall Flat': 'end-terrace',
    'Semi Bungalow': 'semi-detached',
    '2 EXT WALL FLAT': 'mid-terrace',
    '2.EXT.WALL FLAT': 'mid-terrace',
    '2 EXT. WALL FLAT': 'mid-terrace',

    'Maisonette: Detached: Ground Floor': 'detached',
    'Maisonette: Enclosed End Terrace: Top Floor': 'enclosed end-terrace',
    'Flat: End Terrace: Basement': 'end-terrace',
    'Flat: Mid Terrace: Basement': 'mid-terrace',
    'Flat: Enclosed Mid Terrace: Basement': 'enclosed mid-terrace',
    'House: Semi Detached: Top Floor': 'semi-detached',
    'House: End Terrace: Ground Floor': 'end-terrace',
    'Maisonette: Enclosed End Terrace: Mid Floor': 'enclosed end-terrace',
    'Bungalow: EnclosedEndTerrace': 'enclosed end-terrace',

    '2 BED MID TERRACED HOUSE': 'mid-terrace',
    '4 BED SEMI DETACHED-PARLOURED': 'semi-detached',
    '2 BED END TERRACED HOUSE': 'end-terrace',
    '3 BED MID TERRACED HOUSE': 'mid-terrace',
    '3 BED SEMI DETACHED HOUSE': 'semi-detached',
    '3 BED MID TERRACE - PARLOURED': 'mid-terrace',
    '3 BED END TERRACE - PARLOURED': 'end-terrace',
    '4 BED+ END TERRACED HOUSE': 'end-terrace',
    '3 BED END TERRACED HOUSE': 'end-terrace',
    '3 BED SEMI DETACHED-PARLOURED': 'semi-detached',
    '4 BED+ END TERRACE - PARLOURED': 'end-terrace',
    '2 BED SEMI DETACHED HOUSE': 'semi-detached',
    '3 BED DETACHED HOUSE': 'detached',
    '2 BED GRD FLR COTT FLT-CNT STR': 'ground floor',
    '2 BED 1ST FLOOR WALKUP FLAT': 'mid-floor',
    '1 BED GRD FL COTT FLAT-OWN ENT': 'ground floor',
    '1 BED 1ST FL WALK UP DECK ACC': 'mid-floor',
    '2 BED MAISONETTE UPPER COM ENT': 'mid-floor',
    '2 BED GRD FLR COTT FLT OWN ENT': 'ground floor',
    '1 BED BUNGALOW': 'unknown',
    '2 BED GRD FL COTT FLT-OWN ENTR': 'ground floor',
    '1 BED 1ST FL COTT FLT-CNT STR': 'mid-floor',
    '1 BED GRD FL WALK UP OWN ENT': 'ground floor',
    '1 BED GRD FLOOR WALKUP FLAT': 'ground floor',
    '2 BED GRD FLOOR WALKUP FLAT': 'ground floor',
    '2 BED 1ST FLR FLT-SHELTERED': 'mid-floor',
    '2 BED BUNGALOW': 'unknown',
    '2 BED GRD FLR COTT FLT(P)-1950': 'ground floor',

    'Ground Floor Front Left': 'ground floor',
    'End-Terrace House': 'end-terrace',
    'Ground floor': 'ground floor',
    'Ground Floor Front Right': 'ground floor',
    'End Terrace (GII List)': 'end-terrace',
    'Semi  Detached House': 'semi-detached',
    'Ground Floor Right': 'ground floor',
    'PB Ground Floor Flat': 'ground floor',
    'Basement and Ground Floor': 'ground floor',
    'Semi-detached bungalow': 'detached',
    'Detached Cottage': 'detached',
    'Lower & Ground Floor': 'ground floor',
    'Ground FLoor Flat': 'ground floor',
    'ground floor': 'ground floor',
    'Ground Floor Left': 'ground floor',
    'Semi-detached House': 'detached',
    'Basement & Lower Ground': 'basement',
    'Semi-Detached  House': 'detached',
    'Ground floor flat -': 'ground floor',
    'Basement Flat': 'basement',
    'semi-detached bungalow': 'semi-detached',
    'Lower Ground Floor Flat': 'ground floor',
    'Ground floor Flat': 'ground floor',
    'Ground Floor flat': 'ground floor',
    'Ground': 'ground floor',
    'Semi detached Bungalow': 'semi-detached',
    'ground floor flat': 'ground floor',
    'Mid terrace House': 'mid-terrace',
    'Raised Ground Floor': 'ground floor',
    'Basement Floor': 'basement',
    'Second floor flat': 'mid-floor',
    'Fourth Floor Flat': 'mid-floor',
    'First/Second Maisonette': 'mid-floor',
    'Ground/First': 'ground floor',
    'First and Second Floor': 'mid-floor',
    'Terrace House': 'mid-terrace',
    '1st/2nd Floor Maisonette': 'mid-floor',
    'Semi-det House': 'semi-detached',
    'First': 'mid-floor',
    'Ground & First Floor': 'ground floor',
    'End of Terrace House': 'end-terrace',
    '2nd Floor Purpose Built': 'mid-floor',
    'First/Second Floor Maison': 'mid-floor',
    'GFF purpose built': 'ground floor',
    'Second': 'mid-floor',
    'Semi-det House (GII List)': 'semi-detached',
    '3rd and 4th Floor': 'mid-floor',
    'First Floor flat': 'mid-floor',
    'Mid-Terrace House': 'mid-terrace',
    '1st & 2nd Floors': 'mid-floor',
    'Ground/first floor': 'ground floor',
    'FFF purpose built': 'mid-floor',
    'Second floor': 'mid-floor',
    'Second/Third floor': 'mid-floor',
    'First floor Flat': 'mid-floor',
    'First floor': 'mid-floor',
    'Lower Ground Flat': 'basement',
    'First Floor Rear Flat': 'mid-floor',
    'First & Second Floor': 'mid-floor',
    'Ground & Lower Ground': 'basement',
    'First Floor Rear': 'mid-floor',
    'First & Second': 'mid-floor',
    'First Floor Front': 'mid-floor',
    'First & Second Floors': 'mid-floor',
    'First/Second Floor': 'mid-floor',
    'Sem-detach house': 'semi-detached',
    'Second Floor Flat (Top)': 'top-floor',
    '3 FloorTerrace House': 'mid-terrace',
    'First floor flat': 'mid-floor',
    'First & Second Floor Flat': 'mid-floor',
    'First Floor Purpose Built': 'mid-floor',
    'Purpose built First Floor': 'mid-floor',

    'Mid-Terrace': 'mid-terrace'
}
