Title Case Converter

פרמיום
Verified
על ידי Matt11 | מְעוּדכָּן לפני 22 ימים | News, Media
פּוֹפּוּלָרִיוּת

9.2 / 10

חֶבִיוֹן

114ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

Option to disable typographic assistance?

Rapid account: Chwise
chwise
לפני 9 חודשים

When a title is supplied with a hyphen (e.g., “Test Title - Second Part”), the returned result fails shell string equivalence matching because the hyphen is replaced with a non-equivalent “en” dash (e.g., “Test Title – Second Part”).

Example:
curl --request GET
–url ‘https://title-case-converter.p.rapidapi.com/v1/TitleCase?title=Test Title - Second Part&style=CMOS&preserveAllCaps=true&useStraightQuotes=true
–header ‘X-RapidAPI-Host: title-case-converter.p.rapidapi.com
–header ‘X-RapidAPI-Key: <redacted>’

Output:
{“result”:“Test Title – Second Part”}

While the Chicago Manual of Style omits spaces around hyphens and dashes, it would be nice to see the supplied hyphen/dash preserved instead of always modified to an “en” dash. Would it be possible to disable typographic assistance for API queries (similar to how it is possible to enable straight quotes)?

Rapid account: Matt 11
Matt11 Commented לפני 9 חודשים

Hi chwise,

The Title Case Converter does this for two reasons:

  • using en (or em) dashes in cases like this is a sign of good typography (just like using curly quotes)
  • it reduces the complexity of the rule set used by the converter

However I can understand that there are cases where you would prefer hyphens. Would a new option, usePlainDashes, help?

  • true: preserve hyphens and convert any present en and em dashes to hyphens
  • false: convert hyphens to en or em dashes where applicable (= current behavior)

Regards,
Matt

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות