我希望这个输出是字符串格式的。怎么做呢?
我正在获得的产出:
[[[[a]|fat]|man],[[[[[was]|walking]|quickly],to],[[[[the]]|end],[of,[[[the]|long]|corridor]]]]]预期产出:
a fat man was walking quickly to the end of the long corridor发布于 2015-05-26 10:34:46
你可以用 和atomic_list_concat/3
:- X = [[[[a]|fat]|man],[[[[[was]|walking]|quickly],to],[[[[the]]|end],[of,[[[the]|long]|corridor]]]]],
flatten(X,Y),
atomic_list_concat(Y,' ',Z).
X = [[[[a]|fat]|man], [[[[[was]|walking]|quickly], to], [[[[the]]|end], [of, [[...|...]|...]]]]],
Y = [a, fat, man, was, walking, quickly, to, the, end|...],
Z = 'a fat man was walking quickly to the end of the long corridor'.https://stackoverflow.com/questions/30455693
复制相似问题