主要内容

++

附加文件

描述

例子

newDocumentsdocuments1+documents2将文档追加到documents2的文件documents1

例子

newDocuments= + (documents1documents2等于newDocuments = documents1 + documents2

例子

全部折叠

加载示例数据。该文件sonnetsPreprocessed.txt包含莎士比亚十四行诗的预处理版本。该文件每行包含一首十四行诗,用空格分隔单词。从中提取文本sonnetsPreprocessed.txt,以换行符将文本分割为文档,然后对文档进行标记。

文件名=“sonnetsPreprocessed.txt”;str = extractFileText(文件名);textData = split(str,换行符);documents = tokenizedDocument(textData);

创建包含前5首和后5首十四行诗的数组。

Documents1 = documents(1:5)
documents1 = 5 x1 tokenizedDocument: 70令牌:美丽的生物欲望增加从而美丽玫瑰可能永远不会死成熟时间流逝的记忆交给娇嫩的后嗣收缩你的明亮的眼睛feedst你灯火焰selfsubstantial燃料使饥荒丰富是你的自我你的敌人你甜蜜的自我残忍你艺术世界新鲜点缀春天华丽使者你自己的花蕾埋葬你的内容投标乡下人makst浪费吝啬鬼遗憾世界其他贪吃的人吃世界由于严重你71令牌:四十个冬天会包围你的额头挖深壕你的美丽的田野你的青春骄傲的制服凝视着破烂的杂草不值得拥有问你的美丽存在珍惜你的青春说你自己深陷的眼睛表示耻辱挥霍的赞美赞美配得上你的美丽你可以回答漂亮的孩子我的将被计数用旧的借口证明美丽继承你的新使你老了你的血液温暖你感到寒冷65个标志:看你的镜子告诉你的脸你看的是时间的脸从另一个人的脸上你更新了它的新鲜的修复你欺骗了世界不祝福的母亲美丽的母亲不听的子宫蔑视耕作你的耕作可爱的坟墓自爱停止后代你是你母亲的镜子你唤回可爱的四月春光你的窗户你的年龄将不顾皱纹你的黄金年华你活着记住孤独你的形象死去你71个标志:挥霍无度的美人,你为什么要把你美丽的遗产,大自然的遗赠,什么也不给,不借给,坦率地,免费地,美丽的吝啬鬼,你为什么要滥用慷慨的慷慨,你要给无息的高利贷者,你为什么要大把大把大把大把的钱,还能活下去,只有你自己,你自己,你可爱的自己,你欺骗大自然,叫你走了,可以接受的审计,你能把你没用过的美丽埋葬吗,你活着,遗嘱者61个记号:时间温柔的工作框架可爱的凝视每只眼睛都住在玩耍暴君同样的不公平公平地超越永不停息的时间导致夏天可怕的冬天困惑汁液被检查的霜冻强壮的叶子完全消失了美丽被白雪覆盖,每年夏天蒸馏留下液体囚犯被囚禁的墙壁玻璃美丽的效果美丽失去了也没有记忆花蒸馏尽管冬天遇到了leese显示物质仍然生活甜蜜
Documents2 = documents(6:10)
标志:让冬天破旧的手玷污你你的夏天在你酿酒之前制造甜蜜的小瓶宝藏你把美丽的宝藏放在你自杀之前禁止高利贷幸福的人自愿偿还贷款那是你自己繁殖另一个你快乐十倍你快乐十倍你快乐十倍你重新定义你死亡你应该离开留下你活着的后代你是美丽的死亡征服让蠕虫成为你的继承人64标志:东方优雅的光抬起燃烧的头眼睛表示敬意新出现的景象服侍的目光神圣的威严爬上高耸的天山像强壮的青年中年但凡人的目光崇拜美丽仍然参加金色的朝圣最高的位置疲惫的车像虚弱的年龄旋转的天眼睛恭顺的转换低的道路看另一个方向你自己出去你的中午不看死除非你得到儿子70个标志:音乐,听听为什么Hearst你是音乐,悲伤的甜蜜的甜蜜的战争欢乐的喜悦的喜悦为什么爱你,你欣然接受否则就欣然接受快乐你的烦恼真正的和谐和谐的声音结合,结婚得罪你的耳朵甜蜜的责备你混淆单身的部分,你应该承担标记琴弦甜美的丈夫另一个敲击相互的节奏像父系孩子快乐的母亲悦耳的音符唱着谁无言的歌许多人似乎唱着你你单身将证明没有70个记号:害怕湿润的寡妇眼睛你耗尽了你自己的单身生活啊你没有子女将会死去世界哀号你就像没有子女的妻子世界你的寡妇还在哭泣你留下了每一个私人寡妇好好照顾孩子们的眼睛丈夫们的心灵面貌不节俭的世界消耗着转移着世界享受着美丽的浪费着世界的尽头不被使用破坏了对别人的爱坐在谋杀的耻辱下69个记号:羞耻,拒绝你,承受爱你自己,是没有远见的让你愿意你被爱的多你没有爱的明显你拥有对你自己的致命的仇恨你坚持阴谋寻求美丽的屋顶毁灭,修复你的主要愿望改变你的思想改变你的心将憎恨更公平的洛德温柔地爱你的存在仁慈的你自己最善良的证明让你另一个自己爱美丽仍然活你的你

把后5首十四行诗加到前5首十四行诗后面。

newDocuments = documents1 + documents2
newDocuments = 5x1 tokenizedDocument: 138个token:美丽的生物欲望增加从而美丽玫瑰可能永远不会死成熟时间流逝的记忆交给娇嫩的后嗣收缩你的明亮的眼睛feedst你灯火焰selfsubstantial燃料使饥荒丰富是你的自我你的敌人你甜蜜的自我残忍你艺术世界新鲜点缀春天华丽使者你自己的花蕾埋葬你的内容投标乡下人makst浪费吝啬鬼遗憾世界其他贪吃的人吃世界由于严重你让冬天衣衫褴褛的手破坏你夏天之前你蒸馏,酿出甜蜜的小瓶宝贝,你把美丽的宝贝放在自杀之前禁止放高利贷幸福的人自愿偿还贷款那是你自己繁殖另一个人你快乐十倍你快乐十倍你快乐十倍你重新做人死亡,你应该离开留下你活着的后代自我意志,你是美丽的死亡征服,让蠕虫成为你的继承人135个象征:四十冬天围攻你的眉毛挖深沟你的美容领域你年轻人骄傲制服盯着tatterd杂草小值得问你的美丽谎言珍惜你说你自己的深凹的眼睛的日夜alleating羞愧浪费的赞美赞美deservd你的美丽你能够回答我公平的孩子应当和计数做借口证明美继承你的新老你老你的血液温暖你feelst冷瞧东方的轻撩起燃烧头眼newappearing致敬sight serving looks sacred majesty climbd steepup heavenly hill resembling strong youth middle age yet mortal looks adore beauty still attending golden pilgrimage highmost pitch weary car like feeble age reeleth day eyes fore duteous converted low tract look another way thou thyself outgoing thy noon unlookd diest unless thou get son 135 tokens: look thy glass tell face thou viewest time face form another whose fresh repair thou renewest thou dost beguile world unbless mother fair whose uneard womb disdains tillage thy husbandry fond tomb selflove stop posterity thou art thy mothers glass thee calls back lovely april prime thou windows thine age shalt despite wrinkles thy golden time thou live rememberd die single thine image dies thee music hear why hearst thou music sadly sweets sweets war joy delights joy why lovst thou thou receivst gladly else receivst pleasure thine annoy true concord welltuned sounds unions married offend thine ear sweetly chide thee confounds singleness parts thou shouldst bear mark string sweet husband another strikes mutual ordering resembling sire child happy mother pleasing note sing whose speechless song many seeming sings thee thou single wilt prove none 141 tokens: unthrifty loveliness why dost thou spend upon thy self thy beautys legacy natures bequest gives nothing doth lend frank lends free beauteous niggard why dost thou abuse bounteous largess thee give profitless usurer why dost thou great sum sums yet canst live traffic thy self alone thou thy self thy sweet self dost deceive nature calls thee gone acceptable audit canst thou leave thy unused beauty tombed thee lives th executor fear wet widows eye thou consumst thy self single life ah thou issueless shalt hap die world wail thee like makeless wife world thy widow still weep thou form thee hast left behind every private widow well keep childrens eyes husbands shape mind look unthrift world doth spend shifts place still world enjoys beautys waste hath world end kept unused user destroys love toward others bosom sits murdrous shame commits 130 tokens: hours gentle work frame lovely gaze every eye doth dwell play tyrants same unfair fairly doth excel neverresting time leads summer hideous winter confounds sap checked frost lusty leaves quite gone beauty oersnowed bareness every summers distillation left liquid prisoner pent walls glass beautys effect beauty bereft nor nor remembrance flowers distilld though winter meet leese show substance still lives sweet shame deny thou bearst love thy self art unprovident grant thou wilt thou art belovd many thou none lovst evident thou art possessd murderous hate gainst thy self thou stickst conspire seeking beauteous roof ruinate repair thy chief desire o change thy thought change mind shall hate fairer lodgd gentle love thy presence gracious kind thyself least kindhearted prove make thee another self love beauty still live thine thee

输入参数

全部折叠

输入文档,指定为tokenizedDocument数组中。documents1而且documents2必须是一样的尺寸。

输入文档,指定为tokenizedDocument数组中。documents1而且documents2必须是一样的尺寸。

输出参数

全部折叠

输出文档,返回为tokenizedDocument数组中。

在R2017b中引入