בבא קמא ה:ד · Bava Kamma 5:4

שׁוֹר שֶׁהָיָה מִתְכַּוֵּן לַחֲבֵרוֹ וְהִכָּה אֶת הָאִשָּׁה וְיָצְאוּ יְלָדֶיהָ, פָּטוּר מִדְּמֵי וְלָדוֹת. וְאָדָם שֶׁהָיָה מִתְכַּוֵּן לַחֲבֵרוֹ וְהִכָּה אֶת הָאִשָּׁה וְיָצְאוּ יְלָדֶיהָ, מְשַׁלֵּם דְּמֵי וְלָדוֹת. כֵּיצַד מְשַׁלֵּם דְּמֵי וְלָדוֹת, שָׁמִין אֶת הָאִשָּׁה כַּמָּה הִיא יָפָה עַד שֶׁלֹּא יָלְדָה וְכַמָּה הִיא יָפָה מִשֶּׁיָּלָדָה. אָמַר רַבָּן שִׁמְעוֹן בֶּן גַּמְלִיאֵל, אִם כֵּן, מִשֶּׁהָאִשָּׁה יוֹלֶדֶת, מַשְׁבַּחַת. אֶלָּא שָׁמִין אֶת הַוְּלָדוֹת כַּמָּה הֵן יָפִין, וְנוֹתֵן לַבַּעַל. וְאִם אֵין לָהּ בַּעַל, נוֹתֵן לְיוֹרְשָׁיו. הָיְתָה שִׁפְחָה וְנִשְׁתַּחְרְרָה, אוֹ גִיּוֹרֶת, פָּטוּר:
In the case of an ox that was intending to gore another ox but struck a pregnant woman, and her offspring, i.e., the fetuses, emerged due to miscarriage, the owner of the ox is exempt from paying compensation for miscarried offspring. But in the case of a person who was intending to injure another but struck a pregnant woman instead, and her offspring emerged due to miscarriage, he pays compensation for miscarried offspring. How does he pay compensation for miscarried offspring, i.e., how is their value assessed? The court appraises the value of the woman by calculating how much she would be worth if sold as a maidservant before giving birth, and how much she would be worth after giving birth. He then pays the difference in value to the woman’s husband. Rabban Shimon ben Gamliel said: If so, the consequences would be absurd, as when a woman gives birth her value increases. Rather, the court appraises how much the offspring are worth, and the one liable for the damage gives that amount to the husband. And if she does not have a husband, e.g., her husband died, he gives the money to his heirs. If the pregnant woman was a Canaanite maidservant and then she was emancipated, or a convert, and she was married to an emancipated Canaanite slave or to a convert who died without any heirs, the one who caused the damage is exempt from pay-ing compensation for miscarried offspring. This is because this payment is made specifically to the husband, not to the woman.

Word-by-word Breakdown (מילים ושרשים)

שׁוֹר → an ox [שׁ - ו - ר]שֶׁהָיָה → that was [ה - י - ה]מִתְכַּוֵּן → intending [כ - ו - ן]לַחֲבֵרוֹ → another [ח - ב - ר]וְהִכָּה → and struck [נ - כ - ה]אֶת → [direct object marker] הָאִשָּׁה → the woman [א - ש - ה]וְיָצְאוּ → and emerged [י - צ - א]יְלָדֶיהָ → her offspring [י - ל - ד]פָּטוּר → exempt [פ - ט - ר]מִדְּמֵי → from payment of [ד - מ - ה]וְלָדוֹת → offspring [י - ל - ד]וְאָדָם → and a person [א - ד - ם]שֶׁהָיָה → who was [ה - י - ה]מִתְכַּוֵּן → intending [כ - ו - ן]לַחֲבֵרוֹ → another [ח - ב - ר]וְהִכָּה → and struck [נ - כ - ה]אֶת → [direct object marker] הָאִשָּׁה → the woman [א - ש - ה]וְיָצְאוּ → and emerged [י - צ - א]יְלָדֶיהָ → her offspring [י - ל - ד]מְשַׁלֵּם → pays [ש - ל - ם]דְּמֵי → payment of [ד - מ - ה]וְלָדוֹת → offspring [י - ל - ד]כֵּיצַד → how מְשַׁלֵּם → does he pay [ש - ל - ם]דְּמֵי → payment of [ד - מ - ה]וְלָדוֹת → offspring [י - ל - ד]שָׁמִין → they appraise [ש - מ - ם / שׁ - מ - י]אֶת → [direct object marker] הָאִשָּׁה → the woman [א - ש - ה]כַּמָּה → how much הִיא → she יָפָה → is worth [י - פ - ה]עַד → before [ע - ד - ד]