Complex sentence: In the Middle Ages, these counties became the basis for Catalonia under the rule of the counts of Barcelona, Frankish vassals nominated by the emperor of the Franks, to whom they were feudatories (801--987).
Split into simpler sentences: In the Middle Ages, these counties became the basis for Catalonia under the rule of the counts of Barcelona. The counts of Barcelona were Frankish vassals nominated by the emperor of the Franks, to whom they were feudatories (801--987).