Text this: Computing the Metric Dimension of a Graph from Primary Subgraphs