Hi all,
I want to build a compressed suffix trie from a string for string
matching.instea d of doing like:
input:a string with 10 chars
insert char array 10
insert char array 9,10
insert char array 8,9,10
....
insert char array 1,2,3,4,5,6,7,8 ,9,10
is there any efficient way to build a trie?
the above method is toooo slow and consum much memory!
Thanks a lot guys 3 4376
Joseph wrote: I want to build a compressed suffix trie from a string for string matching.instea d of doing like:
input:a string with 10 chars
insert char array 10 insert char array 9,10 insert char array 8,9,10 ... insert char array 1,2,3,4,5,6,7,8 ,9,10
is there any efficient way to build a trie? the above method is toooo slow and consum much memory!
char array[11] = {0};
const char * const trie[] = { array + 9, array + 8, ... , array };
Now input your 10 chars in 'array' and use 'trie[5]' to get to
the fifth (sixth) "string".
You can use the same method for dynamically sized string and trie.
Victor
Victor Bazarov <v.********@com Acast.net> wrote in news:ZAi4d.2801 $Ae.2102
@newsread1.dlls tx09.us.to.veri o.net: Joseph wrote: I want to build a compressed suffix trie from a string for string matching.instea d of doing like:
input:a string with 10 chars
insert char array 10 insert char array 9,10 insert char array 8,9,10 ... insert char array 1,2,3,4,5,6,7,8 ,9,10
is there any efficient way to build a trie? the above method is toooo slow and consum much memory!
char array[11] = {0}; const char * const trie[] = { array + 9, array + 8, ... , array };
Now input your 10 chars in 'array' and use 'trie[5]' to get to the fifth (sixth) "string".
You can use the same method for dynamically sized string and trie.
Victor
Oh ,sorry ,I mean,is there any faster way to do the compression?
OR a dynamic way ?to do the insertion and compression at same time
Joseph wrote: Victor Bazarov <v.********@com Acast.net> wrote in news:ZAi4d.2801 $Ae.2102 @newsread1.dlls tx09.us.to.veri o.net:
Joseph wrote:
I want to build a compressed suffix trie from a string for string matching.ins tead of doing like:
input:a string with 10 chars
insert char array 10 insert char array 9,10 insert char array 8,9,10 ... insert char array 1,2,3,4,5,6,7,8 ,9,10
is there any efficient way to build a trie? the above method is toooo slow and consum much memory!
char array[11] = {0}; const char * const trie[] = { array + 9, array + 8, ... , array };
Now input your 10 chars in 'array' and use 'trie[5]' to get to the fifth (sixth) "string".
You can use the same method for dynamically sized string and trie.
Victor
Oh ,sorry ,I mean,is there any faster way to do the compression?
OR a dynamic way ?to do the insertion and compression at same time
Oh, sorry, I thought you're asking a C++ language question. You should
find a better place to ask general programming questions, like forum
'comp.programmi ng' or anything related to compression...
V This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Keith Bowes |
last post by:
I have a script for requesting HTTP resources and I want it to use HTTP
compression (to reduce bandwidth), if possible. What's the best way to
do this? I've tried using zlib functions but they always return FALSE.
And I've tried to use the zlib wrapper, which works but makes
non-compressed resources take longer.
TIA.
|
by: Klaus Neuner |
last post by:
Hello,
I need a function that converts a list into a set of regexes. Like so:
string_list =
print string_list2regexes(string_list)
This should return something like:
|
by: Dennis Hotson |
last post by:
Hi,
I'm trying to write a function that adds a file-like-object to a
compressed tarfile... eg ".tar.gz" or ".tar.bz2"
I've had a look at the tarfile module but the append mode doesn't support
compressed tarfiles... :(
Any thoughts on what I can do to get around this?
|
by: Polar |
last post by:
Hi!
Do you know a C library for trie data structures (a particular type of
tree)? And some link about trie with C language?
Thank you
Polar
|
by: Paul |
last post by:
Does anyone have an example of a trie data structure implemented in c#? I'm
looking for a string trie to use to hold the word list for my spell checker.
Any examples or suggestions would be great.
thanks
Paul
| |
by: Pavel |
last post by:
Hello.
I am trying to make a folder compressed and failing miserably. Below
are three ways that I tried to make it compressed, all of them compile
and run w/o any problems, but the folder is still not-compressed.
(using NTFS, win2k)
// some folder
string path = @"C:\TEMP\";
|
by: robert |
last post by:
Hello,
I want to put (incrementally) changed/new files from a big file tree
"directly,compressed and password-only-encrypted" to a remote backup
server incrementally via FTP,SFTP or DAV.... At best within a closed
algorithm inside Python without extra shell tools.
(The method should work with any protocol which allows somehow read,
write & seek to a remote file.)
On the server and the transmission line there should never be...
|
by: clintp |
last post by:
I've seen a few people asking for this elsewhere, so here's a basic
implementation of a string trie in C#. I'm using this to load and
search a dictionary of about two hundred thousand words. It's fairly
quick (a couple of seconds for the full load). It's a bit of a memory
hog -- about 50MB resident, once the file is loaded -- but most of my
C#/.NET programs are.
Example usage:
StringTrie st = new StringTrie();
|
by: iaminsik |
last post by:
I implemented a TRIE in memory by myself in C.
But, as you know, when a size of data increases, loading time of data
becomes longer.
I want to implement a TRIE in file, which means division of INDEX &
DATA in file and
whenever a user asks a data, TRIE accesses a disk according to INDEX.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |