mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2025-12-31 00:21:44 +01:00
Merge branch 'fix_plurals'
This commit is contained in:
@@ -7,3 +7,4 @@ codecov
|
||||
ghp-import
|
||||
pyright
|
||||
types-PyYAML
|
||||
inflect
|
||||
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
import inflect
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Dict, List, Mapping, Tuple
|
||||
from copy import deepcopy
|
||||
@@ -94,6 +95,10 @@ data_unit_multipliers = {
|
||||
'%': 1,
|
||||
}
|
||||
|
||||
|
||||
inflection = inflect.engine()
|
||||
|
||||
|
||||
HUB_TYPE_PARAMETERS = ('S',)
|
||||
|
||||
|
||||
@@ -284,11 +289,15 @@ def md_italic(l):
|
||||
|
||||
|
||||
def singular(s):
|
||||
if s.endswith('ies'):
|
||||
return s[:-3] + 'y'
|
||||
if s[-1] == 's':
|
||||
return s[:-1]
|
||||
return s
|
||||
if s.lower().endswith('data'):
|
||||
return s
|
||||
|
||||
single_noun = inflection.singular_noun(s)
|
||||
|
||||
if single_noun is False:
|
||||
return s
|
||||
else:
|
||||
return single_noun
|
||||
|
||||
|
||||
def split_camelcase_s(s):
|
||||
|
||||
Reference in New Issue
Block a user