因此,我正在查询一个字符限制为500个字符的数据库。如果查询文本确实超出了此限制;我想将字符串拆分为尽可能大且尽可能少的碎片,同时保持属性,即字符串中包含的文本在语法上仍然有效。换句话说,我希望所有拆分的子代字符串都具有完整的句子。
if len(inpt) > 500:
# Here is where I'd like to implement the code, or perhaps abstract it to a function even #
client.query( ... ) # Query each subset on its own to bypass the limit