Primitive Constructs in Text
- Sentences/Input strings
- Words or Tokens
- Characters
- The document, larger files
1.split():
The split() method splits a string into
a list. You can specify the separator, the default separator is any whitespace.
2.len()
len() is a built-in function in python. You can use the len() to get the length of the given string, array, list, tuple, dictionary, etc.
3.Query to get Specific word on some criteria
Example 1: Find words that are more than 4 letters long
Example2: Find out a string which are starting with a capital letter
No comments:
Post a Comment