Also, to explain the patterns [^<:>]+ is "match any string of characters that doesn't contain a tag or a colon"
So the grep is "anything without tags or colons (i.e. a surface form) then a colon then another string (a lemma) then a <n> tag" The sed matches roughly the same thing except it has () around the lemma so it can refer to it later and .* to match whatever tags there may be. \1 then replaces the line with the contents of the first (), i.e. the lemma. On Fri, Apr 24, 2020 at 10:19 AM Daniel Swanson <awesomeevildu...@gmail.com> wrote: > If you do want them mixed together, replacing <n> with > (<vblex>|<vbmod>|<vbser>|<vbhaver>) should do it. > > On Fri, Apr 24, 2020 at 10:02 AM Alberto Navalón Lillo < > alberto.navalonli...@gmail.com> wrote: > >> For me this works: >> lt-expand apertium-swe.swe.dix | grep -E "[^<:>]+:[^<:>]+<vblex>" | sed >> -E 's/[^<:>]+:([^<:>]+).*/\1/g' | sort -u >> >> Though you will only get the <vblex> verbs, not others like <vbmod>, >> <vbser> or <vbhaver>. This might be useful if you want to keep all of those >> categories separate. Change the <vblex> I highlighted by the any of the >> other verb categories listed in >> http://wiki.apertium.org/wiki/List_of_symbols and it should be fine. >> >> Best, >> Alberto >> >> On Fri, Apr 24, 2020 at 3:52 PM Per Tunedal <per.tune...@operamail.com> >> wrote: >> >>> Hi, >>> Now I would like to list the verbs. I cannot fully understand the grep- >>> and sed expressions for getting the nouns: >>> >>> lt-expand apertium-swe.swe.dix | grep -E "[^<:>]+:[^<:>]+<n>" | sed -E >>> 's/[^<:>]+:([^<:>]+).*/\1/g' | sort -u >>> >>> How should I modify the expressions to get the verbs instead? >>> >>> Yours, >>> Per Tunedal >>> >>> >>> _______________________________________________ >>> Apertium-stuff mailing list >>> Apertium-stuff@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/apertium-stuff >>> >> >> >> -- >> Alberto Navalón Lillo https://albertonl.github.io >> IES María Blasco >> E-03690 Sant Vicent del Raspeig >> Spain >> >> EN: You can learn more about me here >> <https://albertonl.github.io/about/en>. Thank you! >> ES: Usted puede aprender más sobre mí aquí >> <https://albertonl.github.io/about/es>. ¡Gracias! >> CA: Vosté pot aprendre més sobre mi ací >> <https://albertonl.github.io/about/ca>. Gràcies! >> LV: Jūs varat mācīties vairāk par mani šeit >> <https://albertonl.github.io/about/lv>. Paldies! >> _______________________________________________ >> Apertium-stuff mailing list >> Apertium-stuff@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/apertium-stuff >> >
_______________________________________________ Apertium-stuff mailing list Apertium-stuff@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/apertium-stuff