Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
	Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
			
		
		
			- 
				
																			 richmond62
- Livecode Opensource Backer
  
- Posts: 10202
- Joined: Fri Feb 19, 2010 10:17 am
						
						
													
							
						
									
						Post
					
								by richmond62 » Mon Feb 19, 2018 9:54 pm
			
			
			
			
			it's very close to a good hyphen
Well, as we know, all good programmers go to "Hyphen"
while bad programmers have to make a dash for it  

 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 dunbarx
- VIP Livecode Opensource Backer
  
- Posts: 10392
- Joined: Wed May 06, 2009 2:28 pm
						
						
													
							
						
									
						Post
					
								by dunbarx » Mon Feb 19, 2018 9:59 pm
			
			
			
			
			Max.
Am i misunderstanding how to use your function? I get massively truncated lines with any sort of text, and hyphens in all the wrong places.
Craig
			
			
									
									
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 dunbarx
- VIP Livecode Opensource Backer
  
- Posts: 10392
- Joined: Wed May 06, 2009 2:28 pm
						
						
													
							
						
									
						Post
					
								by dunbarx » Mon Feb 19, 2018 10:01 pm
			
			
			
			
			Richmond.
  
 
Craig
 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 bogs
- Posts: 5480
- Joined: Sat Feb 25, 2017 10:45 pm
						
						
													
							
						
									
						Post
					
								by bogs » Mon Feb 19, 2018 10:04 pm
			
			
			
			
			Don't sweat it Richmond, I appreciated it 

 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by MaxV » Tue Feb 20, 2018 12:19 pm
			
			
			
			
			dunbarx wrote: ↑Mon Feb 19, 2018 9:59 pm
Max.
Am i misunderstanding how to use your function? I get massively truncated lines with any sort of text, and hyphens in all the wrong places.
Craig
 
If you want max 80 chars per line into a field:
Code: Select all
put field "myLongText" into temp
put  hypnen( temp, 80) into field "myLongText"
In Italian works quite good, I have just to fix with punctuation marks:
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 dunbarx
- VIP Livecode Opensource Backer
  
- Posts: 10392
- Joined: Wed May 06, 2009 2:28 pm
						
						
													
							
						
									
						Post
					
								by dunbarx » Tue Feb 20, 2018 4:15 pm
			
			
			
			
			Ah, I see what happened. i misunderstood what "tSize" meant. It means the length of a line.
Craig
			
			
									
									
						 
		 
				
		
		 
	 
	
				
	
				
		
		
			- 
				
																			 theotherbassist
- Posts: 115
- Joined: Thu Mar 06, 2014 9:29 am
						
						
													
							
						
									
						Post
					
								by theotherbassist » Sat Feb 24, 2018 1:08 pm
			
			
			
			
			Hypnen! Sounds like great ambient prog-disco.
I like the simplicity of it. Maybe a few more rules could even tighten things up a bit more on average... does anyone know the actual Knuth–Liang hyphenation algorithm? I can't seem to find the nuts and bolts of it--only a bunch of talk about it.
			
			
									
									
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 [-hh]
- VIP Livecode Opensource Backer
  
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
						
						
													
							
						
									
						Post
					
								by [-hh] » Sat Feb 24, 2018 7:12 pm
			
			
			
			
			theotherbassist wrote:... does anyone know the actual Knuth–Liang hyphenation algorithm?
Here's Liang's thesis as PDF
http://www.tug.org/docs/liang/
Beneath my link above (hunspell) there is also a brilliant JavaScript implementation based on that:
https://github.com/mnater/Hyphenator
I implemented it already (via a browser widget for english, french, german, italian and spanish). Works fine.
shiftLock happens