Summary of the invention
The present invention is directed in prior art, the shortcoming poor to the optimizing process controllability of building blocks letter scheme, provide a kind of method and the product of determining finite number building blocks letter scheme, effectively can solve the intervention of developer in the optimizing process of building blocks letter scheme and control problem, and developer can be made to determine degree of optimization as required.
For achieving the above object, the present invention can take following technical proposals:
Determine a method for finite number building blocks letter scheme, comprise predetermined building blocks combination and the predetermined dictionary I comprising limited quantity word comprising finite number building blocks; Wherein, described building blocks are polyhedron, and at least one face of building blocks is provided with letter, and the building blocks in the combination of described building blocks are corresponding with a unique numbering; Described letter is the letter occurred in described dictionary I, described dictionary I at least comprises a word subset, after described dictionary I removes described word subset, remaining word is dictionary II, described word subset is predetermined limited quantity and quantity is less than the set of letters of the word quantity that dictionary I comprises, and the word that described word subset comprises all is contained in dictionary I;
Also comprise following concrete steps:
Traversal step: each word in traversal dictionary II, appearance order remaining building blocks do not mated in described building blocks combination according to the letter of composition word mate, record carries out the numbering of the building blocks mated, the number of times that the building blocks that record carries out mating respectively mate with arbitrary letter;
Coupling step: the step recorded according to traversal step, chooses a word and carries out mating and record in word subset;
Optimization Steps I: select the building blocks number identical with the number of letters of word selected in described coupling step in being combined by described building blocks respectively, the building blocks that each letter of selected word is unique with one respectively carry out corresponding, the building blocks identical with the number of letters of word selected in described coupling step are made to be maximum with the total quantity of the matching times of corresponding letter, using the letter that the letter corresponding with building blocks inherently occurs on these building blocks;
Circulation step: the above-mentioned coupling step that circulates and Optimization Steps I until the word quantity that be not selected in word subset be zero or Optimization Steps complete after number of letters that specific building blocks inherently occur be greater than the maximum number of the letter that described specific building blocks can hold.
Further, as the optional scheme of one, in the embodiment of the application, following concrete steps are also comprised:
Optimization Steps II: in described building blocks combination, for each building blocks selects with the quantity in the face of this building blocks identical alphabetical number maximum with the summation of the matching times of these building blocks as the letter that these building blocks there will be;
Described Optimization Steps II is before coupling step or carry out after Optimization Steps I, and the letter that the specific building blocks that obtain of Optimization Steps II there will be can should occur determining the alphabetical rear that these building blocks inherently occur on these building blocks.
Further, as the optional scheme of one, in the embodiment of the application, following concrete steps are also comprised:
Reducing and describe step: by choosing a word in dictionary I, removing the letter of this word and mating between building blocks, and the corresponding matching times reduced between letter and building blocks; Again the letter that specific building blocks will inevitably occur is determined according to described circulation step; When redefining the arbitrary matching times of rear building blocks with letter and being less than the smallest match number of times of letter in the word chosen, reject the word that this is chosen.
Further, as the optional scheme of one, in the embodiment of the application, described minimizing describes in step, and the word chosen is the word comprising the minimum letter of matching times.
Further, as the optional scheme of one, in the embodiment of the application, described building blocks are hexahedron.
Further, as the optional scheme of one, in the embodiment of the application, all of described building blocks are provided with single letter.
Further, as the optional scheme of one, in the embodiment of the application, also comprise pre-treatment step: when the alphabetical number comprised in the arbitrary word in dictionary I exceeds the number of building blocks in building blocks combination, this word is counted the number of the word list do not supported or increase building blocks.
Further, as the optional scheme of one, in the embodiment of the application, in described traversal step, when in certain words, the number of letter is less than the quantity of building blocks in the combination of described building blocks, the building blocks identical with alphabetical number be selected according to building blocks or the order of the number random selecting equal number of letter are maximum with the total quantity of the matching times of corresponding letter.
Further, as the optional scheme of one, in the embodiment of the application, described total quantity is maximumly refer to that matching times is added or the result that is multiplied is maximum.
A kind of building blocks obtained according to the method for above-mentioned determination finite number building blocks letter scheme.
The present invention has following remarkable technique effect:
By adjustment word subset and choosing certain words, developer can control the optimizing process of building blocks letter scheme easily, makes its direction needed towards developer be optimized.The step recorded in the method for the application, can make developer relatively easily realize above-mentioned purpose, and can the progress of control and optimize, can adjust at any time as required, prevent unnecessary amount of calculation.
Detailed description of the invention
Below in conjunction with embodiment, the present invention is described in further detail.
Embodiment 1
Determine a method for finite number building blocks letter scheme, as shown in Figure 1, 2, but in order to for simplicity, the starting point of flow process shown in Fig. 1 is the preposition building blocks letter scheme of Non-precondition one to its flow process, and the flow process recorded with following examples is slightly different.Method described in the application is not mainly used in determining building blocks, is generally hexahedron building blocks, on six faces get any six alphabetical optimized building blocks letter scheme respectively, this object is only the secondary objective of this method.The main purpose of this method is the prioritization scheme providing to existing building blocks letter scheme.As everyone knows, the application of the application is the building blocks of finite number, typically the number of building blocks can not be too much, so that adapt to the needs of child, in addition also also non-required is excessive for the dictionary required for child, therefore, can compare all possible building blocks letter scheme completely, thus find out the scheme of or several optimums.But defect of method is in this, amount of calculation is bigger than normal, and developer cannot be provided with the differentiation of priority, and this is very important, but developer needs specific word to add dictionary, or based on considering in marketing, when needing the building blocks increasing or reduce certain number, such scheme just cannot provide developer one clear and result fast, and developer just can obtain last data after having to wait for all project plan comparison.
Therefore, first the method described in the present embodiment comprises predetermined building blocks combination and the predetermined dictionary I comprising limited quantity word comprising finite number building blocks, wherein, described building blocks are polyhedron, although building blocks are generally hexahedron, also be described with regular hexahedron in the present embodiment, but in the present embodiment, other various polyhedrons are suitable for too, the such as polyhedron of various regular polygon or other shapes, at least one face of building blocks is provided with letter, all of the present embodiment building blocks above not all need to arrange letter, generally for and try to please child, need to arrange other decorative patterns or pattern on one of building blocks or several faces, to this, alternatively, when carrying out the method described in the present embodiment, total face number that can will the face number that letter is set be needed to be considered as building blocks, this is also an advantage place of this method.On the other hand, the method that the present embodiment is recorded also is applicable to various language, but in order to narrate conveniently, the letter in the present embodiment and word all take from English, but this does not represent that the method that the present embodiment is recorded can not use other language or word.Further, the building blocks in the combination of described building blocks are corresponding with a unique numbering, and in other words, needs can determine specific building blocks uniquely, and because the letter that each building blocks is arranged may be all different, needs can distinguish specific building blocks.
Further, described letter is the letter occurred in described dictionary I, clearly, the repetitive letter often occurred in word must be comprised, this means on different building blocks, need to have at least the letter that or some are arranged to be identical, the quantity of this same letter also determines the size of supported word dictionary.After final building blocks letter scheme is determined, dictionary I is total set of the word that this building blocks letter scheme can be supported, usually can pass through existing larger dictionary, such as English, the capacity knowing dictionary I is analyzed one by one to the dictionary of level Four or six grades of examinations.Described dictionary I at least comprises a word subset; this word subset can comprise one or several words usually; the quantity of the word that word subset comprises is that developer is required and very important; through word subset; developer can control the building blocks letter scheme finally obtained, and makes it can meet the requirement of developer.In actual applications, although different building blocks letter scheme local letters arranges possibility difference, with regard to specific word, these different building blocks letter scheme are then identical, clearly, are because apply same or roughly close word subset.Need further it is clear that, word subset be used to optimize before scheme compare, such as, developer wishes in existing building blocks letter scheme, add word apple or zoo do not supported, the word that so word subset comprises just only has one.In other words, after comparing with more existing building blocks letter scheme, the quantity of the word that word subset comprises then may be more.For convenience's sake, after described dictionary I is removed described word subset, remaining word is designated as dictionary II, the set of letters that building blocks letter scheme before dictionary II is actually optimization can be supported, in the present embodiment, the importance of dictionary II is not high, consider that the building blocks letter scheme before optimization may be the result of another suboptimization, also may be a building blocks letter scheme determined at random or arbitrarily, therefore very do not consider dictionary II in the present embodiment, only need the scope can determining dictionary II.Described word subset is predetermined limited quantity and quantity is less than the set of letters of the word quantity that dictionary I comprises, and the word that described word subset comprises all is contained in dictionary I.It is to be noted, the word that dictionary I and word subset comprise all needs to determine in advance, but this does not also mean that and can not modify to it, with regard to the method that the present embodiment is recorded, the effect of changing dictionary I just can be played only by the size changing word subset.
Secondly, the method that the present embodiment is recorded also comprises following concrete steps:
Traversal step (100): each word in traversal dictionary II, certainly before traversal, need input dictionary I and word subset, and some process are carried out to dictionary I, comprise duplicate removal, convenient in order to computer application, usually a doubly linked list can be set up, in chained list, store basic word information simultaneously, such as word length, the letter etc. comprised, but doubly linked list is also inessential, other description form can be adopted in non-computer field, as described below, even if in computer realm, other data structure can be adopted too to be described.Appearance order remaining building blocks do not mated in described building blocks combination according to the letter of composition word mate; in other words; with regard to a word; from left to right successively the letter in word is mated; record carries out the numbering of the building blocks mated; the number of times that the building blocks that record carries out mating respectively mate with arbitrary letter; with regard to computer application; usually iteration can be carried out to accumulate the number of times of coupling; in the data structure of record matching number of times; one then can be adopted to describe space to carry out record, as shown in following table 1,2.
Table 1 building blocks initially describe space
Table 2 carries out the description space after semi-match
This describes space and is being a two-dimentional tables of data intuitively, record the description counting of building blocks numbering and each building blocks respectively, describe counting and refer to matching times that is that specific building blocks may use but not the letter of final utilization, in other words, for a word apple, need to carry out split by choosing 5 in building blocks, therefore, five building blocks are corresponding in turn to five letters.Like this, in theory, as long as building blocks quantity is fixed, the word quantity in dictionary I is abundant, and building blocks need to mate the letter likely occurred.This is also describing in space the reason describing counting and need to record respectively specific building blocks and the matching times of the letter likely occurred.Coupling described in the present embodiment refers to before not determining the letter that each face of specific building blocks is arranged, suppose that these specific building blocks can choose arbitrarily each letter, after taking out a letter in turn according to spelling in by a word, this letter must be found on these specific building blocks, therefore create and once mate; And according to spelling the next one letter taken out in turn, also must mate with the specific building blocks of the next one, the like.
Above step is only create the description space that can be recorded matching times between building blocks and letter, in order to determine optimum building blocks letter scheme, particularly the word comprised in word subset will be added, also need to carry out following steps:
Coupling step (200): the step recorded according to traversal step (100), chooses a word and carries out mating and record in word subset.This step and above-mentioned traversal step (100) difference are, only choose a word, then perform following Optimization Steps I (300).
Optimization Steps I (300): select the building blocks number identical with the number of letters of word selected in described coupling step (200) in being combined by described building blocks respectively, this is apparent, for word apple, need five building blocks and carry out split and can complete.The building blocks that each letter of selected word is unique with one respectively carry out corresponding, an i.e. corresponding letter of building blocks, and repetitive letter also will count, the building blocks identical with the number of letters of word selected in described coupling step (200) are made to be maximum with the total quantity of the matching times of corresponding letter, using the letter that the letter corresponding with building blocks inherently occurs on these building blocks, for the described letter that must occur referring to that the needs produced relative to other steps of the present embodiment occur on building blocks, its priority is higher, should prioritizing selection, and after completing the determination of the letter of the high priority on building blocks, on building blocks, previous prioritization scheme can be deferred in the letter in other faces.In extreme circumstances, if preposition prioritization scheme cannot be known, according to the following record of the present embodiment, can re-start and calculate.Wherein, the selection of the building blocks identical with the number of letters that word comprises is arbitrary, this causes when in building blocks combination, the sum of building blocks is greater than the quantity of letter in word, select different building blocks can produce multiple prioritization scheme, but because amount of calculation is little, can compare these prioritization schemes, generally speaking, make the total quantity of matching times maximum.The total quantity that it is pointed out that here not refers to the summation of matching times, as following.In addition, it is to be noted, although from literal, this step final result produces the letter that must come across on building blocks, but due to dictionary II may be based on another preposition optimization after building blocks letter scheme, therefore in most of the cases, without the need to adjusting the letter scheme on building blocks, in other words, the building blocks letter scheme based on dictionary II can hold the word newly increased.
Circulation step (400): circulate above-mentioned coupling step (200) and Optimization Steps I (300) are until the word quantity be not selected in word subset is zero, or the number of letters after Optimization Steps () completes, specific building blocks inherently occurred is greater than the maximum number of the letter that specific building blocks can hold, with regard to hexahedron, it is 6.The former is easier to understand, more than one of the word in word subset, and needs wherein will all incorporate existing building blocks letter scheme by all words; With regard to the latter, illustrate that the building blocks letter scheme before optimizing cannot hold the word newly increased, therefore need to readjust the letter on building blocks, but the quantity of the letter readjusted should not exceed the sum of the letter that building blocks can hold, otherwise will impact building blocks itself, be equivalent to the quantity in the face adding building blocks.
Further, described scheme also comprises following concrete steps, it is to be noted, following steps are equivalent to reproduce the building blocks letter scheme before optimizing, but as aforementioned, scheme before optimization may be randomizing scheme, also may be another prioritization scheme, therefore the program only can produce one of them possible result, or also directly an existing building blocks letter scheme can be brought the preposition scheme as above-mentioned Optimization Steps I (300), or when the building blocks letter scheme matched with dictionary II cannot be known, this step can be applied and calculate generation.Optimization Steps II (301) concrete steps comprise:
Optimization Steps II (301): in described building blocks combination, for each building blocks selects with the quantity in the face of this building blocks identical alphabetical number maximum with the summation of the matching times of these building blocks as the letter that these building blocks there will be.
Described Optimization Steps II (301) is carried out before coupling step (200) or after Optimization Steps I (300), and the letter that the specific building blocks that obtain of Optimization Steps II (301) there will be can should occur determining the alphabetical rear that these building blocks inherently occur on these building blocks.The letter that the priority of the letter that Optimization Steps II (301) determines is determined lower than Optimization Steps I (300).
Further, described scheme also comprises following concrete steps:
Reduce and describe step (302): by choosing a word in dictionary I, this word can comprise the minimum letter of matching times usually, removes the letter of this word and mating between building blocks, and the corresponding matching times reduced between letter and building blocks; Again the letter that specific building blocks will inevitably occur is determined according to described circulation step (400); When redefining the arbitrary matching times of rear building blocks with letter and being less than in the word chosen the smallest match number of times of letter, now more weak owing to creating one, building blocks-monogram that namely matching times is less, then reject the word that this is chosen.
This step has two effects, and an effect is rejected by the word no longer needed in dictionary; A scheme that can describe maximum dictionary with minimum building blocks is found in another effect, therefore, reduce description step (302) can constantly repeatedly perform, until produce after one according to Optimization Steps II, (301) redefine matching relationship, the result that the matching times between specific one building blocks and particular letter equals 0.Describe step () by performing gold whistle, developer constantly can get involved in the process optimized, and the process of control and optimize, finally obtain the scheme of a satisfaction.
Further, described scheme also comprises, and described building blocks are hexahedron, and certainly, other various polyhedrons are also suitable for the method for the present embodiment record.
Further, described scheme also comprises, and all of described building blocks are provided with single letter, or in other words, the side surface being only provided with the building blocks of letter is called as a face just now.
Further, described scheme also comprises, pre-treatment step (101): when the alphabetical number comprised in the arbitrary word in dictionary I exceeds the number of building blocks in building blocks combination, this word is counted the number of the word list do not supported or increase building blocks.
Further, described scheme also comprises, in described traversal step (100), when in certain words, the number of letter is less than the quantity of building blocks in the combination of described building blocks, the building blocks identical with alphabetical number be selected according to building blocks or the order of the number random selecting equal number of letter are maximum with the total quantity of the matching times of corresponding letter.
Further, described scheme also comprises, and described total quantity is maximumly refer to that matching times is added or the result that is multiplied is maximum.
Finally, according to method described in the present embodiment, developer tests 1982 words taking from primary school+junior middle school's word list altogether, and test shows, when building blocks quantity is 5 is, the word quantity of support is 21.4%; When building blocks quantity is 6, the word quantity of support is 35.1%; When building blocks quantity is 7, the word quantity of support is 48.6%.
Based on above-mentioned test result, inventor give also one preferably after building blocks letter scheme, as shown in table 3 below:
Building blocks are numbered |
Building blocks scheme |
1 |
H、L、N、U、X、Y |
2 |
E、K、L、N、P、T |
3 |
G、M、P、S、T、V |
4 |
B、F、J、Q、M、W |
5 |
A、E、I、O、R、U |
6 |
C、D、L、S、Y、Z |
7 |
K、N、O、P、R、S |
The preferred building blocks letter scheme of table 3
In a word, the foregoing is only preferred embodiment of the present invention, all equalizations done according to the present patent application the scope of the claims change and modify, and all should belong to the covering scope of patent of the present invention.