Below are the key words which are present in an array
{ “ST”, “RD”, “STREET”, “ROAD”, “AVE”, “AVENUE”, “TERRACE”, “CT”, “CCT”, “ARC”, “Link”, “TCE”, “SQ”, “SQUARE”, “RIDGE”, “RDGE”, “PLACE”, “PL”, “CLOSE”, “VOULEVARD”, “ALLEY”, “Jnc”, “PARADE”, “PDE”, “LANE”, “HIGHWAY”, “HWY”, “GROVE”, “GR”, “CL”, “BVD”, “ALLY”, “Mews”, “ESPLANADE”, “ESP”, “DRIVE”, “DR”, “CRESCENT”, “CRES”, “COURT”, “CIRCUIT”, “ARCADE”, “STRT”, “Boulevard”, “Bypass”, “Bypa”, “Corner”, “Crn”, “Cul-de-sac”, “Cds”, “Green”, “Grn”, “Junction” }
How to match above keywords with the below given Texts
if in given text a keyword is found, then need to extract the text prior to keyword as an address
text suffix to keyword need to extract as an suburb
5A NORTH WEST ARM ROAD GYMEA
14 SASSAFRAS ST PARKLEA
83 BLANDFORD STREET COLLAROY PLATEAU NSW
6 HARSTON AVENUE MOSMAN SYDNEY