Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

text splitter

def text_splitter(t):
    t = re.sub(r'[^ws]','',text)
    data = pd.DataFrame(columns=['text','output'])
    for i in range(len(t.split())):
        text = ' '.join(t.split()[0:i+1])
        temp_text = ' '.join(t.split()[i+1:])
        for k in range(len(temp_text.split())):
            output = ' '.join(temp_text.split()[:k+1])
    #         print(text,'----',output)
            data = data.append({'text':text, 'output':output}, ignore_index=True)
    return data
  
  
  
  
t = 'How do I reset a password in windows'
text_splitter(t)

text	output
0	How	do
1	How	do I
2	How	do I reset
3	How	do I reset a
4	How	do I reset a password
5	How	do I reset a password in
6	How	do I reset a password in windows
7	How do	I
8	How do	I reset
9	How do	I reset a
10	How do	I reset a password
11	How do	I reset a password in
12	How do	I reset a password in windows
13	How do I	reset
14	How do I	reset a
15	How do I	reset a password
16	How do I	reset a password in
17	How do I	reset a password in windows
18	How do I reset	a
19	How do I reset	a password
20	How do I reset	a password in
21	How do I reset	a password in windows
22	How do I reset a	password
23	How do I reset a	password in
24	How do I reset a	password in windows
25	How do I reset a password	in
26	How do I reset a password	in windows
27	How do I reset a password in	windows
Comment

PREVIOUS NEXT
Code Example
Csharp :: regex c# password numbers and letters 
Csharp :: unity3d change player position 
Csharp :: Specified key was too long; max key length is 1000 bytes (SQL: alter table `permissions` add unique `permissions name guard_name_unique`(`name`, `guard_name`)) 
Csharp :: how to make an object jump in unity 
Csharp :: c# switch by type of object 
Csharp :: beep sound in c# 
Csharp :: c# connect to mongodb 
Csharp :: c# read file from path 
Csharp :: dart extending list 
Csharp :: ef core detach entity 
Csharp :: unity change tmp text from script 
Csharp :: how to add a list to observablecollection in c# 
Csharp :: how to cjeck if a string has a word c# 
Csharp :: how to delete from a list c# 
Csharp :: Prevent player rotation unity 
Csharp :: c# string is not null or empty 
Csharp :: how to map datatable to list in c# 
Csharp :: datagridview column color c# 
Csharp :: C# How to write Hello World 
Csharp :: weighted random c# 
Csharp :: C# .net core convert string to enum 
Csharp :: how to set up blender with unity units 
Csharp :: c# base64 encode 
Csharp :: c# map 
Csharp :: C# How to read users input and display it 
Csharp :: 2d list in c# 
Csharp :: c# md5 
Csharp :: c# unity get name of object 
Csharp :: c# color hex 
Csharp :: system.io.directorynotfoundexception c# 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =