Click here to Skip to main content
14,297,239 members
Rate this:
Please Sign up or sign in to vote.
See more:
so I got a load of adjectives from Downloading WordNet and associated packages and tools | WordNet[^]

its pretty cool but they have a load of text that could be deemed irrelevant in front and after each adjective i need to get rid of this
each line more or less looks like this

00006277 00 a 01 relative 0 004 + 05151023 n 0101 ! 00005186 a 0101 & 00006433 a 0000 & 00006607 a 0000 | not absolute or complete; "a relative stranger"

with a constant amount of characters infront and a varying amount of text after the adjective i need to extract the adjective from each line

What I have tried:

i know I have to use readline for each line and as we know how many characters are infront we can state do a substring starting from index just before the adjective,we can do this for the whatever is infront and then for after we can do a string.split at the first whitespace resulting in all that is left being the word relative
but i have no idea how to implement this into code.
Updated 2 days ago
Rate this:
Please Sign up or sign in to vote.

Solution 1

The best thing to do is to read the documentation on how all of this works. It may be a little rough as this is over 7 years old...

But there is a C# API project out there on GitHub that may be of assistance:
GitHub - zacg/WordNetAPI: WordNet C# API[^]
Rate this:
Please Sign up or sign in to vote.

Solution 2

string str = "00006277 00 a 01 relative 0 004 + 05151023";
string str2 = str.Substring(17);
str2 = str2.Split(' ')[0];

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100